I'm working on making a two player tic-tac-toe game, and am in the phase where I work out all of the errors in my code. The current error i'm stuck on is an illegal function call
error in the following code:
(cond
[...snip...]
((= CHOICE 3)
(IF (NUMBERP (AREF *BOARD* 0 2))
(SETF (AREF *BOARD* 0 2) *MARKER*)
(INVALID-SELECTION)))
What am I doing wrong?
EDIT The whole function looks like this:
(defun select (choice)
(cond ((= choice 1)
(if (numberp (aref *board* 0 0)) (setf (aref *board* 0 0) *marker*)
(invalid-selection))))
((= choice 2)
(if (numberp (aref *board* 0 1)) (setf (aref *board* 0 1) *marker*)
(invalid-selection))))
((= choice 3)
(if (numberp (aref *board* 0 2)) (setf (aref *board* 0 2) *marker*)
(invalid-selection))))
((= choice 4)
(if (numberp (aref *board* 1 0)) (setf (aref *board* 1 0) *marker*)
(invalid-selection))))
((= choice 5)
(if (numberp (aref *board* 1 1)) (setf (aref *board* 1 1) *marker*)
(invalid-selection))))
((= choice 6)
(if (numberp (aref *board* 1 2)) (setf (aref *board* 1 2) *marker*)
(invalid-selection))))
((= choice 7)
(if (numberp (aref *board* 2 0)) (setf (aref *board* 2 0) *marker*)
(invalid-selection))))
((= choice 8)
(if (numberp (aref *board* 2 1)) (setf (aref *board* 2 1) *marker*)
(invalid-selection))))
((= choice 9)
(if (numberp (aref *board* 2 2)) (setf (aref *board* 2 2) *marker*)
(invalid-selection))))