Karl von Laudermann
3/30/2007 2:09:00 PM
On Mar 30, 7:55 am, Ruby Quiz <j...@grayproductions.net> wrote:
> # 99 seconds is 1:39, but 99 is less movement than 139
> microwave(99) => 99
>
> # 71 seconds is only two keys, but entering 111 is far less movement.
> microwave(71) => 111
>
> # 120 seconds is 2 minutes, and 200 is slightly less movement than 120
> microwave(120) => 200
>
> # 123 seconds is 2:03, but 203 is a lot more distance
> microwave(123) => 123
Unless I'm missing something (and I usually am), the problem with the
last two examples is that the microwave will interpret "120" and "123"
as 1:20 and 1:23 when typed in, not as a raw number of seconds. How
the microwave interprets the number depends solely on whether the last
two digits exceed 59. If they do, it's a number of seconds, otherwise
it's minutes and seconds.
Maybe there should be an additional requirement of the quiz: the
program will never suggest the number of seconds representation, even
when that's more efficient than the minutes and seconds
representation, if the the number of seconds representation will be
misinterpreted (i.e. the last two digits are 60 or greater).
Actually, I'm not even convinced that a microwave would interpret e.g.
"170" as 170 seconds, or 2:50. Perhaps 170 would be interpreted as one
minute and 70 seconds? In other words, after counting down for 70
seconds, the display would read "1:00", and then proceed to 59 instead
of 99, not remembering the 70 that it started with.