11# Instructions
22
3- Given a 3 x 4 grid of pipes, underscores, and spaces, determine which number is represented, or whether it is garbled.
3+ Optical Character Recognition or OCR is software that converts images of text into machine-readable text.
4+ Given a grid of characters representing some digits, convert the grid to a string of digits.
5+ If the grid has multiple rows of cells, the rows should be separated in the output with a ` "," ` .
46
5- ## Step One
7+ - The grid is made of one of more lines of cells.
8+ - Each line of the grid is made of one or more cells.
9+ - Each cell is three columns wide and four rows high (3x4) and represents one digit.
10+ - Digits are drawn using pipes (` "|" ` ), underscores (` "_" ` ), and spaces (` " " ` ).
611
7- To begin with, convert a simple binary font to a string containing 0 or 1.
12+ ## Edge cases
813
9- The binary font uses pipes and underscores, four rows high and three columns wide.
14+ - If the input is not a valid size, your program should indicate there is an error.
15+ - If the input is the correct size, but a cell is not recognizable, your program should output a ` "?" ` for that character.
1016
11- ``` text
12- _ #
13- | | # zero.
14- |_| #
15- # the fourth row is always blank
16- ```
17-
18- Is converted to "0"
19-
20- ``` text
21- #
22- | # one.
23- | #
24- # (blank fourth row)
25- ```
26-
27- Is converted to "1"
28-
29- If the input is the correct size, but not recognizable, your program should return '?'
30-
31- If the input is the incorrect size, your program should return an error.
32-
33- ## Step Two
17+ ## Examples
3418
35- Update your program to recognize multi-character binary strings, replacing garbled numbers with ?
36-
37- ## Step Three
38-
39- Update your program to recognize all numbers 0 through 9, both individually and as part of a larger string.
40-
41- ``` text
42- _
43- _|
44- |_
45-
46- ```
47-
48- Is converted to "2"
19+ The following input (without the comments) is converted to ` "1234567890" ` .
4920
5021``` text
5122 _ _ _ _ _ _ _ _ #
52- | _| _||_||_ |_ ||_||_|| | # decimal numbers.
23+ | _| _||_||_ |_ ||_||_|| | # Decimal numbers.
5324 ||_ _| | _||_| ||_| _||_| #
54- # fourth line is always blank
25+ # The fourth line is always blank,
5526```
5627
57- Is converted to "1234567890"
58-
59- ## Step Four
60-
61- Update your program to handle multiple numbers, one per line.
62- When converting several lines, join the lines with commas.
28+ The following input is converted to ` "123,456,789" ` .
6329
6430``` text
6531 _ _
@@ -75,5 +41,3 @@ When converting several lines, join the lines with commas.
7541 ||_| _|
7642
7743```
78-
79- Is converted to "123,456,789".
0 commit comments