kozima #3557(2007/10/29 13:33 GMT) [ Common Lisp ] Rating6/6=1.00
あれこれ考えていたらこれで解が出るような気がしました。 探索を書かせるのが趣旨だったらごめんなさい。
1 2 3
(defun water-puzzle (a b c) (loop for (x y) in `((,a ,b) (,b ,c) (,c ,a)) if (zerop (mod (- x y) 3)) minimize (max x y)))
Rating6/6=1.00-0+
1 reply [ reply ]
kozima
#3557()
[
Common Lisp
]
Rating6/6=1.00
(defun water-puzzle (a b c) (loop for (x y) in `((,a ,b) (,b ,c) (,c ,a)) if (zerop (mod (- x y) 3)) minimize (max x y)))Rating6/6=1.00-0+
1 reply [ reply ]