Imagine the following 24-hour clock that can be controlled by arrow keys:
╔══╗ ┌──┐ ║00║:│00│ ╚══╝ └──┘ HH mm
Pressing the up arrow twice (
↑↑) will increase the currently focused hour input:
╔══╗ ┌──┐ ║02║:│00│ ╚══╝ └──┘ HH mm
Pressing the right arrow (
→) will focus the other input.
┌──┐ ╔══╗ │02│:║00║ └──┘ ╚══╝ HH mm
Pressing the down arrow thrice (
↓↓↓) will now decrease this input.
┌──┐ ╔══╗ │02│:║57║ └──┘ ╚══╝ HH mm
- The up arrow (
↑) will increase the currently active input.
- The down arrow (
↓) will decrease the active input.
- The right arrow (
→) will move focus to the right input.
- The left arrow (
←) will move focus to the left input.
- Up and down movement will loop around as expected for a time input.
- Left and right movement don't loop around.
The clock starts out at
00:00 with the hour input active (see first schematic). Given a list of input commands, output the resulting time in
Input can be either a string or a list (or your language equivalent), where the different input directions can be one of the below options:
- actual arrow key presses if your program has a GUI
Standard loopholes apply.
↑↑→↓↓↓ = 02:57 ↓→↑←↑→↓ = 00:00 ↓→→↓ = 23:59 ←←←←→↑ = 00:01 ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓→↓ = 23:59