fixed minor bug in number guessing game

This commit is contained in:
John Mair 2011-02-19 07:06:33 +13:00
parent df4e19edb3
commit b56a05e71c
1 changed files with 2 additions and 2 deletions

View File

@ -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