A* search algorithm: Difference between revisions

Content added Content deleted
m (→‎{{header|OCaml}}: just a typo)
m (Ol: small simplification)
Line 1,711: Line 1,711:
(+ (<< (car xy) 16) (cdr xy)))
(+ (<< (car xy) 16) (cdr xy)))


; naive test for "is the cell is empty?"
; "is the cell is empty?"
(define (floor? x y)
(define (floor? x y)
(let ((line (lref level y)))
(let ((line (list-ref level y)))
(if (pair? line)
(if line (not (eq? (list-ref line x) 1)))))
(eq? (lref line x) 0))))


(unless (equal? from to) ; search not finished yet
(unless (equal? from to) ; search not finished yet