mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-28 21:54:17 -08:00
missed trapping ctrl+c, neatened up if
This commit is contained in:
@@ -11,9 +11,7 @@ end
|
||||
def get_facets
|
||||
while true
|
||||
number = gets.chomp
|
||||
if /^\d+$/.match(number)
|
||||
return number.to_i
|
||||
end
|
||||
return number.to_i if /^\d+$/.match(number)
|
||||
puts "!NUMBER EXPECTED - RETRY INPUT LINE"
|
||||
print "? "
|
||||
end
|
||||
@@ -42,4 +40,6 @@ def main
|
||||
draw_diamonds(lines)
|
||||
end
|
||||
|
||||
trap "SIGINT" do puts; exit 130 end
|
||||
|
||||
main
|
||||
Reference in New Issue
Block a user