Starting with an empty 5-gallon jug and an empty 11-gallon jug, how can we end up with exactly 3 gallons of water in the 11-gallon jug and with the 5-gallon jug empty?
I want to write a function in Lisp that computes a list of successor states for any state in this puzzle
my solution
(0 0) > (5 0) > (0 5) > (5 5) > (0 10 ) > (5 10)>(4 11)>(4 0)>(0 4)>(5 4)>(0 9)>(5 9)>(3 11)>(3 0)>(0 3)
How can I implement successors
function?
(setq initial-state '(0 0))
(setq fill-jug1-state '(5 0))
(setq fill-jug2-state '(0 11))
(setq full '(5 11))
(defparameter *jug-1* 5)
(defparameter *jug-2* 11)
(defun successors (initial-state)
)
please help !!!!
Here is a hint to start: