forked from Mirror/wren
Flush prompt in animals example.
This commit is contained in:
@ -1,4 +1,4 @@
|
|||||||
import "io" for Stdin
|
import "io" for Stdin, Stdout
|
||||||
|
|
||||||
// Implements the classic "Animals" guessing game. The user thinks of an animal.
|
// Implements the classic "Animals" guessing game. The user thinks of an animal.
|
||||||
// The program asks a series of yes/no questions to try to guess the animal
|
// The program asks a series of yes/no questions to try to guess the animal
|
||||||
@ -27,6 +27,7 @@ class Node {
|
|||||||
// Writes a prompt and reads a string of input.
|
// Writes a prompt and reads a string of input.
|
||||||
promptString(prompt) {
|
promptString(prompt) {
|
||||||
System.write("%(prompt) ")
|
System.write("%(prompt) ")
|
||||||
|
Stdout.flush()
|
||||||
return Stdin.readLine()
|
return Stdin.readLine()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user