Art stolen from What size is the digit?
7-segment digits can be represented in ASCII using _|
characters. Here are the digits 0-9
:
_ _ _ _ _ _ _ _
| | | _| _| |_| |_ |_ | |_| |_|
|_| | |_ _| | _| |_| | |_| _|
Your job is to parse the art into normal numbers.
Notes on numbers
- Each digit has a different width.
1
has a width of1
3
and7
are2
wide245689
and0
are all3
wide
Also between each digit is one char of padding. Here is the full char set:
// <-- should be one space, but SE formatting messed it up | | ------------- _ _| |_ ------------- _ _| _| ------------- |_| | ------------- _ |_ _| ------------- _ |_ |_| ------------- _ | | ------------- _ |_| |_| ------------- _ |_| _| ------------- _ | | |_|
Input
Input can be either from the console or as a string arg to a function.
Output
Output is either put to the console or is returned from the function.
Examples:
_ _ _
| | | |_
| | | |_|
1776
_ _ _
_| | | | |_
|_ |_| | |_|
2016
_ _
| |_| |_| |_
| _| | _|
1945
_ _ _ _ _ _
| | | | | | | | | | | | |
| |_| |_| |_| |_| |_| |_|
1000000
_ _ _ _ _ _ _ _
| | | _| _| |_| |_ |_ | |_| |_|
|_| | |_ _| | _| |_| | |_| _|
0123456789
This is code-golf so shortest byte count wins!