Ruby bug exercise Microwave

Is it me or this test is not god? One minute has 60 second no 100 seconds, so test doesn’t put right answer

If you press 100 it’s interpretted by most digital microwaves as being 1:00 (pressing the buttons fill in the time from the RHS). I’d like to explicltely add this to the README though, as I don’t think it’s very clear.

2 Likes

Again, confusion continues with test number 11: what is logic behind this calculation? In wich point minutes are overflow or in other words: when do we add minutes and to what do we add them? is there any range for that or what?

can you explain me please, I dont use microwave at all so I am not sure how it works…

Under 100 is seconds. 100 or over is minutes + seconds.

Like:
456 is 4:56 but
476 is 4:(76 seconds = 1:16 minutes ) → 4+1:16 → 5:16 minutes?

No, like:

  • 1 is 0:01, so converted to 00:01
  • 2 is 0:02 so converted to 00:02
  • 59 is 0:59 so converted to 00:59
  • 60 is 0:60 so converted to 01:00
  • 99 is 0:99, so converted to 01:39
  • 100 is 1:00, so converted to 01:00
  • 101 is 1:01, so converted to 01:01

Think about pressing buttons and the number filling from the RHS, then being converted when you hit “Start”

But how much is 199? we can not display 99 second, so we must convert it somehow

Sorry, yes. This is correct. I misread it.

1 Like

From test input is 272 and it expect 3:12 as result, so we can convert it like: 2:(72=1:12)->(2+1):12-> 3:12?

That’s correct

1 Like

The google timer has the same behavior you can play with it here: timer - Google Search

Did you want to avoid giving an example like 567 == 5 minutes and 67 seconds ?

No, just it is not very intuitive. We don’t know how ‘smart’ is microwave :)