mirror of
https://github.com/Xevion/lisp-projects.git
synced 2025-12-06 03:15:36 -06:00
prompting script
This commit is contained in:
11
test.lisp
Normal file
11
test.lisp
Normal file
@@ -0,0 +1,11 @@
|
||||
(defun read-3-numbers-&-format-sum ()
|
||||
(flet ((prompt (string)
|
||||
(format t "~&~a: " string)
|
||||
(finish-output)
|
||||
(read nil 'eof nil)))
|
||||
(let ((x (prompt "first number"))
|
||||
(y (prompt "second number"))
|
||||
(z (prompt "third number")))
|
||||
(format t "~&the sum of ~a, ~a, & ~a is:~%~%~a~%"
|
||||
x y z (+ x y z)))))
|
||||
(read-3-numbers-&-format-sum)
|
||||
Reference in New Issue
Block a user