I feel like I'm abusing when also
http://pastebin.com/3hGHGyGT
This unholy mass is not functioning correctly
ideally i wanted to think of it as if 1 2 3 = 1 then return T for win/placement, but it doesn't seem to want to work
the players number is 1
the computers number is 2
(defun checkwin (board &optional player)
(print "in check win")
(when (null player)
(setq player 2)
)
(block nil
(when (eql (aref board 0) player)
(when (and (eql (aref board 0) (aref board 1)) (eql (aref board 1) (aref board 2))) (return T))
(when (and (eql (aref board 0) (aref board 4)) (eql (aref board 1) (aref board 8))) (return T))
(when (and (eql (aref board 0) (aref board 3)) (eql (aref board 1) (aref board 6))) (return T))
)
(when (eql (aref board 1) player)
(when (and (eql (aref board 1) (aref board 5)) (eql (aref board 7) (aref board 5))) (return T))
)
(when (eql (aref board 2) player)
(when (and (eql (aref board 2) (aref board 4)) (eql (aref board 1) (aref board 3))) (return T))
(when (and (eql (aref board 2) (aref board 5)) (eql (aref board 1) (aref board 8))) (return T))
)
(when (eql (aref board 3) player)
(when (and (eql (aref board 3) (aref board 4)) (eql (aref board 1) (aref board 5))) (return T))
)
(when (eql (aref board 6) player)
(when (and (eql (aref board 6) (aref board 7)) (eql (aref board 1) (aref board 8))) (return T))
))
)
also please critizise coding style