Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defparameter *possible-answers* '((P W Y B) (P B Y W)))
- (defun answer-status ()
- (let ((counters '(((B . 0) (R . 0) (G . 0) (Y . 0) (P . 0) (W . 0))
- ((B . 0) (R . 0) (G . 0) (Y . 0) (P . 0) (W . 0))
- ((B . 0) (R . 0) (G . 0) (Y . 0) (P . 0) (W . 0))
- ((B . 0) (R . 0) (G . 0) (Y . 0) (P . 0) (W . 0)))))
- (loop with c = (copy-tree counters) for j from 0 to 3
- do (loop for possible-answer in *possible-answers*
- do (incf (cdr (assoc (nth j possible-answer) (nth j c)))))
- finally (format t "~{~{~8a~8a~8a~8a~8a~8a~}~%~}" c))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement