Anonymous user
Keyboard input/Obtain a Y or N response: Difference between revisions
Keyboard input/Obtain a Y or N response (view source)
Revision as of 22:42, 8 June 2013
, 10 years ago→{{header|Common Lisp}}
(→{{header|UNIX Shell}}: Added simplified bash version) |
|||
Line 200:
=={{header|Common Lisp}}==
<lang lisp>
(clear-input *
(loop as dum = (format t "Y or N for yes or no: ")
as c = (read-char)
as q = (and (not (equal c #\n)) (not (equal c #\y)))
when q do (format t "~%Need Y or N~%")
unless q return (if (equal c #\y) 'yes 'no)))
</lang>
=={{header|D}}==
|