Inspired by this comment.
Input
The number of seconds on the timer.
Output
Here's our basic microwave:
_____________________________________________________________
| | ___________ |
| | | [display] | |
| ___________________________________ | |___________| |
| | | | | | | | |
| | | | | 1 | 2 | 3 | |
| | | | |___|___|___| |
| | | | | | | | |
| | | | | 4 | 5 | 6 | |
| | | | |___|___|___| |
| | | | | | | | |
| | | | | 7 | 8 | 9 | |
| | | | |___|___|___| |
| | | | | | | |
| | | | | 0 | Start | |
| | | | |___|_______| |
| | | | ___________ |
| |___________________________________| | | | |
| | | | |
| | |___________| |
|_____________________________________________|_______________|
You should replace [display]
with:
- The time left to cook in the format
minutes:seconds
if there is any time left. - The system time in
hours:minutes
if the time left is 0.
Rules
- The display can be aligned in either direction, but the vertical bars need to align with the ones above them.
- You may assume that the input will never be negative and never exceed 59,999,999.
- No leading zeroes before a cook time. Remove the minutes and the colon for inputs less than 60.
- Use 12-hour time UTC with no leading zeroes for the system time.
- Trailing whitespace is allowed.
- Since this is code-golf, the shortest answer in bytes wins.
Display test cases
You should, of course, print the entire microwave along with the display, and it should work for any input within the boundaries, but here are some test cases for the display:
Input Display
100 1:40
59 59
60 1:00
120 2:00
59999999 999999:59
1 1
0 [show system time]
UTC Time Display
00:00 12:00
01:00 1:00
13:04 1:04
|
? I.e is|<equal number of spaces>8:35<equal number of spaces>|
acceptable in place of| 8:35<more spaces>|
? Moreover, it's nicer :-) \$\endgroup\$