Format/typo check 2005/toledo/README.md
This commit is contained in:
1 parent
db16049341
commit
0e5422c707
1 file changed
+25
-6
+25
-6
@@ -25,13 +25,18 @@ make
|
|||||||
Two alternate versions of this entry, [toledo2.c](toledo2.c) and
|
Two alternate versions of this entry, [toledo2.c](toledo2.c) and
|
||||||
[toledo3.c](toledo3.c) are provided.
|
[toledo3.c](toledo3.c) are provided.
|
||||||
|
|
||||||
To compile these alternate versions:
|
|
||||||
|
### Alternate build:
|
||||||
|
|
||||||
|
To compile the alternate versions:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
make alt
|
make alt
|
||||||
```
|
```
|
||||||
|
|
||||||
Use `toledo2` and `toledo3` as you would `toledo` above.
|
### Alternate use:
|
||||||
|
|
||||||
|
Use Use `toledo2` and `toledo3` as you would `toledo` above.
|
||||||
|
|
||||||
|
|
||||||
## Judges' remarks:
|
## Judges' remarks:
|
||||||
@@ -41,6 +46,13 @@ Challenge your knowledge of C operator precedence. The following is the
|
|||||||
move analysis via recursion while it executes moves. All while playing
|
move analysis via recursion while it executes moves. All while playing
|
||||||
by the rules of C and Chess within a single function!
|
by the rules of C and Chess within a single function!
|
||||||
|
|
||||||
|
### Historical note:
|
||||||
|
|
||||||
|
When this entry was submitted the code was a recursive call to `main()` - that
|
||||||
|
was it. In 2023 due to problems with `clang` `main()` calls another function,
|
||||||
|
`pain()`, which calls itself. But it might be said that the Chess is still a
|
||||||
|
single function.
|
||||||
|
|
||||||
|
|
||||||
## Author's remarks:
|
## Author's remarks:
|
||||||
|
|
||||||
@@ -74,31 +86,36 @@ And each successive argument will analyze one
|
|||||||
limit, but beyond 7 ply is very slow, try it at your own risk and computing
|
limit, but beyond 7 ply is very slow, try it at your own risk and computing
|
||||||
time.
|
time.
|
||||||
|
|
||||||
|
|
||||||
### Entering movements
|
### Entering movements
|
||||||
|
|
||||||
When is your turn, you can enter your move, by example, as `d2d4` and press the
|
When it is your turn, you can enter your move, for example, as `d2d4` and press the
|
||||||
enter key. The computer will check move legality and will warn you of illegal
|
enter key. This will move the pawn at `D2` to `D4`, assuming that a pawn is
|
||||||
moves. All legal chess moves are permitted.
|
there (as it would be in the beginning). The computer will check move legality
|
||||||
|
and will warn you of illegal moves. All legal chess moves are permitted.
|
||||||
|
|
||||||
One special case is when you are doing promotion, you must enter the move with
|
One special case is when you are doing promotion, you must enter the move with
|
||||||
an extra letter indicating the desired piece.
|
an extra letter indicating the desired piece.
|
||||||
|
|
||||||
By example `f7f8n` (supposing you have a pawn on `F7`), will promote it to a
|
For example `f7f8n` (supposing you have a pawn on `F7`), will promote it to a
|
||||||
knight; substitute `n` for the desired piece (`N`/`Q`/`R`/`B`).
|
knight; substitute `n` for the desired piece (`N`/`Q`/`R`/`B`).
|
||||||
|
|
||||||
Note that the program requires the piece letter; it will not select
|
Note that the program requires the piece letter; it will not select
|
||||||
automatically a queen, so don't be surprised if it doesn't accept your move.
|
automatically a queen, so don't be surprised if it doesn't accept your move.
|
||||||
|
|
||||||
|
|
||||||
### Game status
|
### Game status
|
||||||
|
|
||||||
The computer will check for checkmate and stalemate. Also, after each machine
|
The computer will check for checkmate and stalemate. Also, after each machine
|
||||||
move, it will show the score of the position: a higher number is better for
|
move, it will show the score of the position: a higher number is better for
|
||||||
the computer, i.e. worse for you.
|
the computer, i.e. worse for you.
|
||||||
|
|
||||||
|
|
||||||
### Quirks
|
### Quirks
|
||||||
|
|
||||||
None.
|
None.
|
||||||
|
|
||||||
|
|
||||||
### Program operation
|
### Program operation
|
||||||
|
|
||||||
This is a good example of a chess program reduced to the essential. In order
|
This is a good example of a chess program reduced to the essential. In order
|
||||||
@@ -115,6 +132,7 @@ they are verified.
|
|||||||
It also sets a standard on ultra-mini-chess programs. The player and the
|
It also sets a standard on ultra-mini-chess programs. The player and the
|
||||||
computer can do all legal chess moves.
|
computer can do all legal chess moves.
|
||||||
|
|
||||||
|
|
||||||
### Additional features
|
### Additional features
|
||||||
|
|
||||||
Other features are:
|
Other features are:
|
||||||
@@ -126,6 +144,7 @@ Other features are:
|
|||||||
7-[ply](https://en.wikipedia.org/wiki/Ply_(game_theory))) and even in 5 ply can give a surprise to
|
7-[ply](https://en.wikipedia.org/wiki/Ply_(game_theory))) and even in 5 ply can give a surprise to
|
||||||
amateur players.
|
amateur players.
|
||||||
|
|
||||||
|
|
||||||
### Obfuscation tricks
|
### Obfuscation tricks
|
||||||
|
|
||||||
* Only one very modular C function.
|
* Only one very modular C function.
|
||||||
|
|||||||
Reference in new issue
Block a user