Last active
May 14, 2020 23:04
-
-
Save WhereIsX/1563257e76381e133aa8ce3a8de579fa 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
MIN = 60 | |
def brb | |
puts 'time?' | |
time = gets.to_i | |
(0..time*MIN).reverse_each do |t| | |
system("clear") | |
minutes = t / MIN | |
seconds = t % MIN | |
puts "#{minutes} : #{seconds.to_s.rjust(2, '0')}" | |
sleep 1 | |
end | |
end | |
brb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment