Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

LISP: A dynamic car

Name: Anonymous 2012-01-30 20:27

I have a complex list of lists and want something to check the second element of every list of the list in the loop, any supported features like this?

Name: Anonymous 2012-02-19 20:57

>>56
I'm off today, meant to use code tags

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

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List