-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathproblem.txt
33 lines (22 loc) · 994 Bytes
/
problem.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
OCR Kata Requirements
1. Accepts four strings of characters ("lines") and returns a
nine-digit account number as a string. Like this:
" _ _ _ _ _ _ _ _ _ "
"|_| |_| |_| |_| |_| |_| |_| |_| |_| "
"|_| |_| |_| |_| |_| |_| |_| |_| |_| "
" "
Example returns: "888888888 "
2. Accepts more than one account number in a single set of strings (so, more than 4).
3. Returns ? for an invalid character.
4. Returns ILL when it contains invalid character. "888888?88 ILL"
YOUR MISSION:
Implement a checksum.
account number: 6 6 4 3 7 1 4 9 5
position names: d9 d8 d7 d6 d5 d4 d3 d2 d1
checksum calculation:
(1*d1+ 2*d2 + 3*d3 + ... + 9*d9) mod 11 = 0
Example returns: "664371495 ERR"
" _ _ _ _ _ _ "
"|_ |_ |_| _| | | |_| |_| |_ "
"|_| |_| | _| | | | _| _| "
" "