A* search algorithm: Difference between revisions

m
small ol simplification
m (small ol simplification)
Line 1,551:
; naive test for "is the cell is empty?"
(define (floor? x y)
(let by-y ((y y)line (maplref level y)))
(condif (pair? line)
(eq? (<lref yline 0x) #true0))))
((null? map) #true)
((= y 0)
(let by-x ((x x) (map (car map)))
(if (< x 0) #true
(if (null? map) #true
(if (= x 0)
(not (eq? (car map) 1))
(by-x (- x 1) (cdr map)))))))
(else
(by-y (- y 1) (cdr map))))))
 
(unless (equal? from to) ; search not finished yet
Line 1,589 ⟶ 1,579:
(parent-of-parent (ref (get c-list-set (hash parent) #f) 2)))
(if parent-of-parent (rev parent)
(cons ;[
(- (car xy) (car parent))
(- (cdr xy) (cdr parent))))))
;c-list-set
;o-list-set
))))
 
(let*((x (car xy))