Enumerate the Microwave Timer
code-golf
Related
Sometimes when I use my microwave, I do a little trolling and enter times such as 2:90
instead of 3:30
because they end up being the same time anyway. The microwave happily accepts this and starts counting down from 2:90
, displaying times like 2:86
and 2:69
until it gets back to a stage where it can count down like a normal timer. Y'all's task today is to simulate this behaviour by returning a list of all times displayed by the microwave when given a starting time.
An Example
Say I input 2:90
into the microwave. It starts at 2:90
and then shows 2:89
, 2:88
, 2:87
, 2:86
, ..., 2:60
, 2:59
, 2:58
, 2:57
, ..., 2:00
, 1:59
, 1:58
, 1:57
, ..., 0:05
, 0:04
, 0:03
, 0:02
, 0:01
, 0:00
. As you can see, where the seconds are less than 60
, it acts as normal. But where the seconds are greater than 60
, it decrements the seconds without impacting the minute count.
Rules
Input can be taken in any convienient and reasonable format, including, but not limited to:
[minutes, seconds]
[seconds, minutes]
minutes
on one line, seconds
on the next
seconds
on one line, minutes
on the next
Output can be given in any convienient and reasonable format, including, but not limited to:
[[minute, second], [minute, second], [minute, second], ...]
["minute second", "minute second", "minute second", ...]
minute second\n minute second\n ...
The outputted times can be returned in any order - they don't need to be sorted.
The seconds will never be greater than 99
.
Make sure to include how you're outputting the times in your answer.
Sample IO
Input here is given as [minutes, seconds]
. Output is given as a list of [minute, seconds]
[0, 90] => [[0, 90], [0, 89], [0, 88], [0, 87], [0, 86], [0, 85], [0, 84], [0, 83], [0, 82], [0, 81], [0, 80], [0, 79], [0, 78], [0, 77], [0, 76], [0, 75], [0, 74], [0, 73], [0, 72], [0, 71], [0, 70], [0, 69], [0, 68], [0, 67], [0, 66], [0, 65], [0, 64], [0, 63], [0, 62], [0, 61], [0, 60], [0, 59], [0, 58], [0, 57], [0, 56], [0, 55], [0, 54], [0, 53], [0, 52], [0, 51], [0, 50], [0, 49], [0, 48], [0, 47], [0, 46], [0, 45], [0, 44], [0, 43], [0, 42], [0, 41], [0, 40], [0, 39], [0, 38], [0, 37], [0, 36], [0, 35], [0, 34], [0, 33], [0, 32], [0, 31], [0, 30], [0, 29], [0, 28], [0, 27], [0, 26], [0, 25], [0, 24], [0, 23], [0, 22], [0, 21], [0, 20], [0, 19], [0, 18], [0, 17], [0, 16], [0, 15], [0, 14], [0, 13], [0, 12], [0, 11], [0, 10], [0, 9], [0, 8], [0, 7], [0, 6], [0, 5], [0, 4], [0, 3], [0, 2], [0, 1], [0, 0]]
[1, 20] => [[1, 20], [1, 19], [1, 18], [1, 17], [1, 16], [1, 15], [1, 14], [1, 13], [1, 12], [1, 11], [1, 10], [1, 9], [1, 8], [1, 7], [1, 6], [1, 5], [1, 4], [1, 3], [1, 2], [1, 1], [1, 0], [0, 59], [0, 58], [0, 57], [0, 56], [0, 55], [0, 54], [0, 53], [0, 52], [0, 51], [0, 50], [0, 49], [0, 48], [0, 47], [0, 46], [0, 45], [0, 44], [0, 43], [0, 42], [0, 41], [0, 40], [0, 39], [0, 38], [0, 37], [0, 36], [0, 35], [0, 34], [0, 33], [0, 32], [0, 31], [0, 30], [0, 29], [0, 28], [0, 27], [0, 26], [0, 25], [0, 24], [0, 23], [0, 22], [0, 21], [0, 20], [0, 19], [0, 18], [0, 17], [0, 16], [0, 15], [0, 14], [0, 13], [0, 12], [0, 11], [0, 10], [0, 9], [0, 8], [0, 7], [0, 6], [0, 5], [0, 4], [0, 3], [0, 2], [0, 1], [0, 0]]
[2, 90] => [[2, 90], [2, 89], [2, 88], [2, 87], [2, 86], [2, 85], [2, 84], [2, 83], [2, 82], [2, 81], [2, 80], [2, 79], [2, 78], [2, 77], [2, 76], [2, 75], [2, 74], [2, 73], [2, 72], [2, 71], [2, 70], [2, 69], [2, 68], [2, 67], [2, 66], [2, 65], [2, 64], [2, 63], [2, 62], [2, 61], [2, 60], [2, 59], [2, 58], [2, 57], [2, 56], [2, 55], [2, 54], [2, 53], [2, 52], [2, 51], [2, 50], [2, 49], [2, 48], [2, 47], [2, 46], [2, 45], [2, 44], [2, 43], [2, 42], [2, 41], [2, 40], [2, 39], [2, 38], [2, 37], [2, 36], [2, 35], [2, 34], [2, 33], [2, 32], [2, 31], [2, 30], [2, 29], [2, 28], [2, 27], [2, 26], [2, 25], [2, 24], [2, 23], [2, 22], [2, 21], [2, 20], [2, 19], [2, 18], [2, 17], [2, 16], [2, 15], [2, 14], [2, 13], [2, 12], [2, 11], [2, 10], [2, 9], [2, 8], [2, 7], [2, 6], [2, 5], [2, 4], [2, 3], [2, 2], [2, 1], [2, 0], [1, 59], [1, 58], [1, 57], [1, 56], [1, 55], [1, 54], [1, 53], [1, 52], [1, 51], [1, 50], [1, 49], [1, 48], [1, 47], [1, 46], [1, 45], [1, 44], [1, 43], [1, 42], [1, 41], [1, 40], [1, 39], [1, 38], [1, 37], [1, 36], [1, 35], [1, 34], [1, 33], [1, 32], [1, 31], [1, 30], [1, 29], [1, 28], [1, 27], [1, 26], [1, 25], [1, 24], [1, 23], [1, 22], [1, 21], [1, 20], [1, 19], [1, 18], [1, 17], [1, 16], [1, 15], [1, 14], [1, 13], [1, 12], [1, 11], [1, 10], [1, 9], [1, 8], [1, 7], [1, 6], [1, 5], [1, 4], [1, 3], [1, 2], [1, 1], [1, 0], [0, 59], [0, 58], [0, 57], [0, 56], [0, 55], [0, 54], [0, 53], [0, 52], [0, 51], [0, 50], [0, 49], [0, 48], [0, 47], [0, 46], [0, 45], [0, 44], [0, 43], [0, 42], [0, 41], [0, 40], [0, 39], [0, 38], [0, 37], [0, 36], [0, 35], [0, 34], [0, 33], [0, 32], [0, 31], [0, 30], [0, 29], [0, 28], [0, 27], [0, 26], [0, 25], [0, 24], [0, 23], [0, 22], [0, 21], [0, 20], [0, 19], [0, 18], [0, 17], [0, 16], [0, 15], [0, 14], [0, 13], [0, 12], [0, 11], [0, 10], [0, 9], [0, 8], [0, 7], [0, 6], [0, 5], [0, 4], [0, 3], [0, 2], [0, 1], [0, 0]]
As this is code-golf, the aim of the game is to get your byte count as low as possible.
Sandbox Meta
- Should there be a requirement to sort outputted times?
- Should there be a limit on the maximum value of the
seconds
?
- Any other recommended tags?