Skip to content

Instantly share code, notes, and snippets.

@chad
Created April 28, 2009 23:29
Show Gist options
  • Save chad/103474 to your computer and use it in GitHub Desktop.
Save chad/103474 to your computer and use it in GitHub Desktop.
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