Dunno which flavor of lisp you're using, but in Scheme it would be
(= a b) for numeric comparison. Try that...
jon.kiparsky
Posting Virtuoso
1,849 posts since Jun 2010
Reputation Points: 383
Solved Threads: 187
Oh, I'm a moron. (0) is the problem - you want just 0, with the parens it means "the function of no argument called "0"
Here's some evaluations:
[1]> (= 2 4)
NIL
[2]> (= 2 2)
T
[3]> (= (0) 1)
*** - EVAL: 0 is not a function name; try using a symbol instead
The following restarts are available:
USE-VALUE :R1 Input a value to be used instead.
ABORT :R2 Abort main loop
Break 1 [4]> (= 0 1)
NIL
Break 1 [4]>
Looks like equal will work as well - I don't know if clisp makes a distinction, I'll play around and see. (I haven't done a lot of common)
jon.kiparsky
Posting Virtuoso
1,849 posts since Jun 2010
Reputation Points: 383
Solved Threads: 187
Okay, good. I was just getting ready to open up an interpreter.
The solution you're using looks like a reasonable one, although you should consider what happens when it hits 15 or 45. That's just a glance over it, though, there may be booby traps I haven't spotted. Good luck.
jon.kiparsky
Posting Virtuoso
1,849 posts since Jun 2010
Reputation Points: 383
Solved Threads: 187