show final board
This commit is contained in:
parent
a7ddb0ff78
commit
e5615419b1
1 changed files with 4 additions and 5 deletions
|
|
@ -35,7 +35,7 @@
|
|||
(while (not (pq-empty? frontier))
|
||||
(let-values ([(node cost) (pop!)])
|
||||
(when (win? node)
|
||||
(return node cost))
|
||||
(return cost node))
|
||||
|
||||
(for-each
|
||||
(lambda (neighbor)
|
||||
|
|
@ -228,8 +228,7 @@
|
|||
'(-1 1 0 0))))
|
||||
|
||||
(define (min-steps b)
|
||||
(define-values (final-board steps) (ucs b board-succ board-won?))
|
||||
steps)
|
||||
(ucs b board-succ board-won?))
|
||||
|
||||
;; by David Buchweitz
|
||||
(define steaming-hot
|
||||
|
|
@ -278,8 +277,8 @@
|
|||
|
||||
|
||||
(define (main . args)
|
||||
(format #t "~a\n"
|
||||
(min-steps (string->board (get-string-all (current-input-port))))))
|
||||
(define-values (cost node) (min-steps (string->board (get-string-all (current-input-port)))))
|
||||
(format #t "~a\n~a\n" cost node))
|
||||
|
||||
;; TODO: lol i have immutable board movement, so just make this actually playable
|
||||
;; with super easy undo lol
|
||||
|
|
|
|||
Loading…
Reference in a new issue