4 ms·
(define-solver yak-solver () (wax-car (car-needs-waxing have-hose) (car-waxed) (car-needs-waxing)) (get-new-hose (have-ez-pass)
by codr7 3y ago
(define-solver yak-solver ()
(wax-car (car-needs-waxing have-hose)
(car-waxed)
(car-needs-waxing))
(get-new-hose (have-ez-pass)
(have-hose))
(borrow-ez-pass (return-mooshi-pillow)
(have-ez-pass))
(fix-mooshi-pillow (have-yak)
(return-mooshi-pillow))
(visit-zoo ()
(have-yak)))
(multiple-value-bind (ok? actions)
(yak-solver '(car-needs-waxing) '(car-waxed))
(assert ok?)
(assert (equal actions
'(VISIT-ZOO
FIX-MOOSHI-PILLOW
BORROW-EZ-PASS
GET-NEW-HOSE
WAX-CAR)))))
- codr7 3y agohttps://github.com/codr7/cl-ps https://github.com/codr7/cl-ps