From: Ruby Quiz Date: 2006-06-09T22:28:20+09:00 Subject: [QUIZ] Running Coach (#82) The three rules of Ruby Quiz: 1. Please do not post any solutions or spoiler discussion for this quiz until 48 hours have passed from the time on this message. 2. Support Ruby Quiz by submitting ideas as often as you can: http://www.rubyquiz.com/ 3. Enjoy! Suggestion: A [QUIZ] in the subject of emails about the problem helps everyone on Ruby Talk follow the discussion. Please reply to the original quiz message, if you can. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= by Benjohn Barnes I've started to jog with my girlfriend. It's hell. We're following a "programme" at this web site: http://www.coolrunning.com/engine/2/2_3/181.shtml The aim is to get you from being able to alternate hobbling and brisk walking, to being able to jog for 20 minutes solidly. Over eight weeks you exercise for twenty minutes, three times a week. Over the eight weeks, the ratio of jog to walk steadily increases, and the jogs get longer, while the walks become shorter. I was explaining to a friend that it's incredibly difficult for me to look at a stop watch and work out in my head if we're supposed to be jogging or walking, how many more jogs we've got to do, and when I can stop and rest. He suggested: 'why not tape yourself giving prompts about when to start and stop'. A brilliant plan. 'Even better, record it on to your phone'. Genius! Except I'm the kind of person who's lazy enough to spend eight times as long writing a program to try to do this for me. So, the quiz is: Write a program to create the tracks for each of the eight weeks. Make it give helpful and enthusiastic advice like "you've got to run for another minute / 30 seconds / 15 seconds ...", "walk now for two minutes, you've got three jogs left", "you're on jog 2 of 6", or "well done, that's your last jog. Don't forget to cool down and stretch!" I just used my Mac's speech synth, and parked my phone near to the speaker on record, in a quiet room (except for the planes every minute heading down to Heathrow). There'd be "bonus points" for actually creating the MP3 directly. Of course, you don't really need to get the computer to speak. It could just print out the messages at the appropriate time.