Keyboard input/Obtain a Y or N response: Difference between revisions
Keyboard input/Obtain a Y or N response (view source)
Revision as of 14:39, 19 March 2024
, 2 months agoUse inputReady instead of the deprecated function keypress
(New post.) |
m (Use inputReady instead of the deprecated function keypress) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1,110:
The task specification that there should be no need for the user to press the enter key,
creates an awkward situation for the Java language.
However, a short program that waits for the user to press return can easily be constructed.
<syntaxhighlight lang="java">
Line 2,049 ⟶ 2,050:
var char: answer is ' ';
begin
while
ignore(getc(KEYBOARD));
end while;
Line 2,333 ⟶ 2,334:
=={{header|Wren}}==
<syntaxhighlight lang="
Stdin.isRaw = true // input is neither echoed nor buffered in this mode
|