matthew.moss.coder
3/30/2007 3:00:00 PM
On 3/30/07, Brown, Warren <warrenbrown@aquire.com> wrote:
> James,
>
> > # 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
>
> How is the microwave supposed to know that "120" is 120 seconds but
> "200" is two minutes? My experience is that microwaves will interpret
> two-digit numbers as seconds and three-digit numbers as minutes and
> seconds. Therefore, "99" is 99 seconds, but "120" is one minute, twenty
> seconds. Am I missing something?
I think the confusion is that I specified input and output to both be
integers, but they don't really mean the same thing.
Input is always seconds... two minutes is "120", five minutes is
"600". Input is NOT the keys you would press.
Output is always the keys to press... It would have been clearer,
perhaps, if I requested the output as an array such as [1, 2, 0,
:cook], or even a string like "120*". When I proposed the problem, I
realized that the "*" (cook) button is always part of the output, so I
could have the function return an integer and the "*" would be
implicit. But this, I think, confused things.
So 120 (or "120*") as output means to push, in order, the buttons 1,
2, 0 and *. Which, for a microwave means 1:20, or 80 seconds.
Does this clear things up?