Fix typos
This commit is contained in:
8
.codebook.toml
Normal file
8
.codebook.toml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
words = [
|
||||||
|
"jali",
|
||||||
|
"listf",
|
||||||
|
"luser",
|
||||||
|
"mlftp",
|
||||||
|
"pdp",
|
||||||
|
"turist",
|
||||||
|
]
|
||||||
30
README.md
30
README.md
@@ -48,17 +48,17 @@ The rules are the following:
|
|||||||
once.
|
once.
|
||||||
- Every 3x3 sub-grid must contain every number between 1 and 9 exactly once.
|
- Every 3x3 sub-grid must contain every number between 1 and 9 exactly once.
|
||||||
|
|
||||||
## Solving Sudokus programatically
|
## Solving Sudokus algorithmically
|
||||||
|
|
||||||
### Backtracking (naïve approach)
|
### Backtracking (naïve approach)
|
||||||
|
|
||||||
Solving a Sudoku can be achieved in serveral ways. The most simple algorithm, is
|
Solving a Sudoku can be achieved in several ways. The most simple algorithm, is
|
||||||
a backtracking algorithm. With this a sudoku can be resolved basically by
|
a backtracking algorithm. With this a sudoku can be resolved basically by
|
||||||
brute-forcing it. In this case, we walk through each cell of the grid
|
brute-forcing it. In this case, we walk through each cell of the grid
|
||||||
recurseivly, and add a number. Then we check, if the grid is still valid. If it
|
recursively, and add a number. Then we check, if the grid is still valid. If it
|
||||||
is, we recursivly move on to the next column. If we find a number that doesn't
|
is, we recursively move on to the next column. If we find a number that doesn't
|
||||||
match, we return to the previous incarnation, and try another number. In order
|
match, we return to the previous incarnation, and try another number. In order
|
||||||
to check, if our grid is still valid, we can use simple function:
|
to check if our grid is still valid, we can use simple function:
|
||||||
|
|
||||||
```C
|
```C
|
||||||
// Function to check, if it is save to place num at mat[row][col]
|
// Function to check, if it is save to place num at mat[row][col]
|
||||||
@@ -149,20 +149,20 @@ even without the front panel, but having the front panel is fancier. You can
|
|||||||
also run [simh](https://opensimh.org/) on a PC, but that would only be half the
|
also run [simh](https://opensimh.org/) on a PC, but that would only be half the
|
||||||
fun.
|
fun.
|
||||||
|
|
||||||
The PiDP-10 shold be booted into ITS, as this is the OS, this project is running
|
The PiDP-10 should be booted into ITS, as this is the OS, this project is
|
||||||
against. Now the only thing you need to do, is copy the source code files into
|
running against. Now the only thing you need to do, is copy the source code
|
||||||
the file system of your PiDP-10. You can do this by using the `mlftp` tool,
|
files into the file system of your PiDP-10. You can do this by using the `mlftp`
|
||||||
installed on the machine your simulator runs on. You clone the repository and
|
tool, installed on the machine your simulator runs on. You clone the repository
|
||||||
run the following commands from the command line:
|
and run the following commands from the command line:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
/opt/pidp10/bin/mlftp -w ITS "SUDOKU 1 JALI;" ./src/sudoku.s
|
/opt/pidp10/bin/mlftp -w ITS "SUDOKU 1 JALI;" ./src/sudoku.s
|
||||||
/opt/pidp10/bin/mlftp -w ITS "PUZZL1 SUDOKU JALI;" ./src/puzzle_1.sudoku
|
/opt/pidp10/bin/mlftp -w ITS "PUZZLE 1 JALI;" ./src/puzzle_1.sudoku
|
||||||
```
|
```
|
||||||
|
|
||||||
This will copy the source code file, and the example puzzle file onto the
|
This will copy the source code file, and the example puzzle file onto the
|
||||||
PiDP-10. Remmber to change the directory name in the ITS path form `JALI` to the
|
PiDP-10. Remember to change the directory name in the ITS path form `JALI` to
|
||||||
directory you want to copy to.
|
the directory you want to copy to.
|
||||||
|
|
||||||
You can now edit both files in EMACS on the PiDP-10. However, if you prefer to
|
You can now edit both files in EMACS on the PiDP-10. However, if you prefer to
|
||||||
edit your code in a somewhat more modern environment (your favourite IDE, for
|
edit your code in a somewhat more modern environment (your favourite IDE, for
|
||||||
@@ -203,9 +203,9 @@ FREE BLOCKS #2=154 #3=169 #0=156 #1=171
|
|||||||
To invoke the solver run it with:
|
To invoke the solver run it with:
|
||||||
|
|
||||||
```
|
```
|
||||||
:SUDOKU PUZZL1 SUDOKU
|
:SUDOKU PUZZLE 1
|
||||||
```
|
```
|
||||||
|
|
||||||
This will pass the file `PUZZL1 SUDOKU` to the program, and start to solve it.
|
This will pass the file `PUZZLE 1` to the program, and start solving it.
|
||||||
|
|
||||||
The result will be printed on the screen (once the project is finished).
|
The result will be printed on the screen (once the project is finished).
|
||||||
|
|||||||
Reference in New Issue
Block a user