Created
September 12, 2020 17:51
-
-
Save ro31337/ee9a5aad087f80e215a300eaf4b8a1ec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INFINITY = 1.to_f / 0 | |
def spaced(s) | |
s.scan(/.{1,5}/).join(' ') | |
end | |
10.times do | |
a = b = INFINITY | |
loop do | |
a = rand(0..10) | |
b = rand(0..10) | |
break if a + b <= 10 | |
end | |
puts "#{a} + #{b} = " | |
puts | |
puts "#{spaced('.' * a)} + #{spaced('.' * b)} =" | |
puts | |
puts | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment