Skip to content

Commit 5366f62

Browse files
🤖 Auto-sync docs, metadata, and filepaths (#3065)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 1cdbfb8 commit 5366f62

File tree

2 files changed

+30
-56
lines changed

2 files changed

+30
-56
lines changed
Lines changed: 24 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,47 @@
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+
## Examples
1718

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
34-
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
28+
The following input is converted to `"123,456,789"`.
6029

61-
Update your program to handle multiple numbers, one per line.
62-
When converting several lines, join the lines with commas.
30+
<!-- prettier-ignore-start -->
6331

6432
```text
65-
_ _
33+
_ _
6634
| _| _|
6735
||_ _|
68-
69-
_ _
70-
|_||_ |_
36+
37+
_ _
38+
|_||_ |_
7139
| _||_|
72-
73-
_ _ _
40+
41+
_ _ _
7442
||_||_|
7543
||_| _|
76-
44+
7745
```
7846

79-
Is converted to "123,456,789".
47+
<!-- prettier-ignore-end -->
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Introduction
2+
3+
Your best friend Marta recently landed their dream job working with a local history museum's collections.
4+
Knowing of your interests in programming, they confide in you about an issue at work for an upcoming exhibit on computing history.
5+
A local university's math department had donated several boxes of historical printouts, but given the poor condition of the documents, the decision has been made to digitize the text.
6+
However, the university's old printer had some quirks in how text was represented, and your friend could use your help to extract the data successfully.

0 commit comments

Comments
 (0)