Code: Select all
(define (parse-move n g)
(let (s (get-move n g))
(if (= 2 (length s))
(filter on-board?
(begin
(if (black-to-move? n)
(let (lst (list (next-diagl s)(next-diagr s)(next-row s)))
(if (= "6" (row s))
(append lst (list (next-row (next-row s))))
(eval 'lst)))
(let (lst (list (prev-diagl s)(prev-diagr s)(prev-row s)))
(if (= "4" (row s))
(append lst (list (prev-row (prev-row s))))
(eval 'lst))))))
(eval nil))))
So how do you handle this kind of thing?