fixed minor bug in number guessing game
This commit is contained in:
parent
df4e19edb3
commit
b56a05e71c
|
@ -447,8 +447,8 @@ e.g: show-method hello_method
|
||||||
count = 0
|
count = 0
|
||||||
while(true)
|
while(true)
|
||||||
count += 1
|
count += 1
|
||||||
str = Readline.readline("game > ", true).chomp
|
str = Readline.readline("game > ", true)
|
||||||
break if str == "."
|
break if str == "." || !str
|
||||||
val = str.to_i
|
val = str.to_i
|
||||||
output.puts "Too large!" if val > num
|
output.puts "Too large!" if val > num
|
||||||
output.puts "Too small!" if val < num
|
output.puts "Too small!" if val < num
|
||||||
|
|
Loading…
Reference in New Issue