Created
April 28, 2009 23:29
-
-
Save chad/103474 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
def start | |
puts "Starting round #{@rounds + 1}" | |
say('start', 5) | |
3.times do |minute| | |
sleep 60 | |
say("Ending minute #{minute + 1}") | |
end | |
@rounds += 1 | |
end | |
def rest | |
say('rest', 5) | |
sleep 60 | |
end | |
def say(what, times = 1) | |
`say #{([what] * times).join(" ")}` | |
end | |
say("Starting in 5 seconds") | |
sleep 5 | |
trap("INT") do | |
puts "That was #{@rounds} rounds" | |
exit! | |
end | |
@rounds = 0 | |
loop do | |
start | |
rest | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment