6
Write a program that prints the current time in a digital watch.
Rules:
- The program must use the local timezone.
- Time is expressed between 00:00 to 23:59 (with only hours and minutes).
- The program must follow the output rules.
- The smallest program wins.
Output (see example):
- Each digit is represented by 4×3 matrix of the characters
␣
(space),|
(pipe) and_
(underscore). - There are two spaces between two digits.
- The
:
(column) is represented with a 1x3 matrix [␣
,.
,.
] and is separated with the digits on both sides by 2 spaces. - A newline at the end of the output is tolerated.
List of digits:
__ __ __ __ __ __ __ __
| | | __| __| |__| |__ |__ | |__| |__|
|__| | |__ __| | __| |__| | |__| __|
Example output: (for 21:08)
__ __ __
__| | . | | |__|
|__ | . |__| |__|
Go!
EDIT: corrected the spaces for :
and 1
2"The : is separated with the digits on both sides by 2 spaces." In your example it has 3 spaces on the left. – Boann – 2014-02-07T11:30:14.033
1@Boann Maybe 1 already has 1 space on each side? – Timtech – 2014-02-07T11:41:50.927
@Boann: no, the
1
digit has spaces included. – Pierre Arlaud – 2014-02-07T12:27:07.027@mniip didn't see that one, but I believe the "glue" between getting the current time and printing the digits makes the golfing interesting. – Pierre Arlaud – 2014-02-07T12:28:16.267
@ArlaudPierre Having the segments of '1' in a different places actually eliminates some clever encoding strategies :( – Boann – 2014-02-07T12:31:49.473
@Boann Okay I've checked in fact there was a missing space. If you look at a digital clock, it usually has 7 segments, and
1
is represented by the two segments on the right so the empty segments on the left add a space (there are 2 spaces before the digit + 1 space for the empty|
+ 2 spaces for the empty__
) – Pierre Arlaud – 2014-02-07T12:35:03.313