missed trapping ctrl+c, neatened up if

This commit is contained in:
Richard Nienaber
2021-02-21 11:37:06 +00:00
parent 736f119e59
commit 9c762c71ce

View File

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