20 lines
343 B
Plaintext
20 lines
343 B
Plaintext
write_line("Guess the number.")
|
|
|
|
let secret_number = random(0..100);
|
|
|
|
loop {
|
|
write_line("Input your guess.")
|
|
|
|
let input = io.read_line();
|
|
let guess = int.parse(input);
|
|
|
|
if guess < secret_number {
|
|
io.write_line("Too low!")
|
|
} else if guess > secret_number {
|
|
io.write_line("Too high!")
|
|
} else {
|
|
io.write_line("You win!")
|
|
break
|
|
}
|
|
}
|