Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
13
Task/Menu/Common-Lisp/menu.lisp
Normal file
13
Task/Menu/Common-Lisp/menu.lisp
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
(defun select (prompt choices)
|
||||
(if (null choices)
|
||||
""
|
||||
(do (n)
|
||||
((and n (<= 0 n (1- (length choices))))
|
||||
(nth n choices))
|
||||
(format t "~&~a~%" prompt)
|
||||
(loop for n from 0
|
||||
for c in choices
|
||||
do (format t " ~d) ~a~%" n c))
|
||||
(force-output)
|
||||
(setf n (parse-integer (read-line *standard-input* nil)
|
||||
:junk-allowed t)))))
|
||||
Loading…
Add table
Add a link
Reference in a new issue