Commit 5c0679f
authored
moo: distinct-digits rule was not followed (briandfoy#933)
* The unix version of moo selects a number where each digit occurs only once in the number [1]
* A guess containing non-unique digits is not a valid guess [2]
* Add a function to check for duplicate digits in guess
* Rewrite secret number generator with shuffle() to guarantee unique digits
1. http://squoze.net/UNIX/v6man/man6/moo.pdf
2. https://github.com/hansklav/MOO1 parent b5df2a2 commit 5c0679f
1 file changed
+21
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | 14 | | |
16 | 15 | | |
17 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
23 | 34 | | |
24 | 35 | | |
25 | 36 | | |
26 | 37 | | |
27 | 38 | | |
28 | 39 | | |
29 | 40 | | |
30 | | - | |
31 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
32 | 47 | | |
33 | 48 | | |
34 | 49 | | |
| |||
39 | 54 | | |
40 | 55 | | |
41 | 56 | | |
42 | | - | |
| 57 | + | |
43 | 58 | | |
44 | 59 | | |
45 | 60 | | |
| |||
99 | 114 | | |
100 | 115 | | |
101 | 116 | | |
102 | | - | |
| 117 | + | |
103 | 118 | | |
104 | 119 | | |
105 | 120 | | |
| |||
0 commit comments