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 22:11

>>57
Sorry, I don't feel like debugging it, but I'll make some more style suggestions.

For defining new variables (lines 5-9) you should use defparameter.
This is up to you, but I always use setf for consistency, even when setq will work. They compile to the same code.
For lines 25-29 and 35-59, I would use cond. For example, the first would be (cond ((evenp counter) ...) (t ...)).
Lines 35-44, without the prints, are equivalent to (setq y (or (check-for-win) (check-for-loss) (random-get))). That's assuming that those functions only return either a number or nil.
Lines 52-53 - (setq x (1- (read)))
Line 60 - (when (< -1 x 9) ...) - same for 76
Lines 76-78 - (and (<= 0 x 8) (= (aref board-values x) 0))

I'm done for now, if you post a new version I'll look at it tomorrow.

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