diff options
| author | Larry Heyl <hairylarry@gmail.com> | 2026-07-12 22:50:13 +0000 |
|---|---|---|
| committer | Larry Heyl <hairylarry@gmail.com> | 2026-07-12 22:50:13 +0000 |
| commit | 2df4eef0566e0115934c5deeed00861ce31ac7be (patch) | |
| tree | e13e14840fcf4f21a3c4450f89decc841a4c2ca9 | |
| parent | f41420a60895154d23963cdd4f5b3b0e42754c3d (diff) | |
mathslap.clisp
The only file for this program.
I run it like this
clisp mathslap.clisp
| -rw-r--r-- | mathslap.clisp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/mathslap.clisp b/mathslap.clisp new file mode 100644 index 0000000..29c7241 --- /dev/null +++ b/mathslap.clisp @@ -0,0 +1,26 @@ +;;;; MathSlap program written by Larry Heyl - Game developed by Carl Heyl +;;;; To win make an equation with the supplied numbers, in order, adding any symbols you want but one and only one equal sign. +;;;; concise instructions +(print"MathSlap") +(print "Hit Enter for another number. q and Enter to quit.") +(setf *random-state* (make-random-state t)) +(defparameter index 0) +(defparameter line "") +(defparameter out "") +;;;; append out with a random number 1 through 10 and a space +(set 'out (concatenate 'string "MathSlap " (write-to-string (+ (random 10) 1)) " ")) +;;;; loop until user types q and Enter +(setf index 1) +(loop + while (< index 10) + do + (+ index 1) +;;;; append out with a random number 1 through 10 and a space + (set 'out (concatenate 'string out (write-to-string (+ (random 10) 1)) " ")) + (print out) + (finish-output) +;;;; wait for input + (setq line (read-line *standard-input*)) + (when (string= line "q")(quit)) +) + |
