prompting script

This commit is contained in:
Xevion
2020-03-02 00:48:53 -06:00
parent 5b97a5e84f
commit 2487b3472c

11
test.lisp Normal file
View 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)