Skip to content

Commit

Permalink
Output tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
dnery committed Jan 8, 2016
1 parent 8004212 commit 07643f0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,29 @@ So far, the engine is capable of generating all legal moves for a certain player
The implementation is modular enough to easily allow for checkmate/stalemate/draw detection in any end-game scenario, with little more code (it is in fact my next goal). Further on I'll be implementing a search mechanism based on **Alpha-beta search** and **Iterative deepening** and a static evaluation mechanism with hopefully-not-so-obvious heuristics, to improve move scoring and the decision making ability.

### How it works
Provide the program with a [*FEN* compliant string](https://en.wikipedia.org/wiki/Forsyth%E2%80%93Edwards_Notation) and it will list all the possible moves for the current player in [algebraic notation](https://en.wikipedia.org/wiki/Algebraic_notation_(chess)), ordered by **score** (best to worst). The scoring mechanism is, so far, simple: It takes into account the moving piece with big bonuses for captures and promotions, varying with piece captured or promoted to. As I said, there's no evaluation mechanism yet, to provide an acceptably precise score for each move.
Provide the program with a [**FEN** compliant string](https://en.wikipedia.org/wiki/Forsyth%E2%80%93Edwards_Notation) and it will list all the possible moves for the current player in [algebraic notation](https://en.wikipedia.org/wiki/Algebraic_notation_(chess)), ordered by **score** (best to worst), along with a drawn board and the _Zobrist_ hash code for the position. The scoring mechanism is, so far, simple: It takes into account the moving piece with big bonuses for captures and promotions, varying with piece captured or promoted to. As I said, there's no evaluation mechanism yet, to provide an acceptably precise score for each move.

Here's an example input...
```
rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
```
...And it's following output
```
A B C D E F G H
*-----------------*
8 | r n b q k b n r | 8
7 | p p p p p p p p | 7
6 | . . . . . . . . | 6
5 | . . . . . . . . | 5
4 | . . . . . . . . | 4
3 | . . . . . . . . | 3
2 | P P P P P P P P | 2
1 | R N B Q K B N R | 1
*-----------------*
A B C D E F G H
Zobrist hash key for position: 8748045942876076066
h3
h4
g3
Expand Down
2 changes: 1 addition & 1 deletion source/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ void drawBoard(Board * board) {
printf(" *-----------------*\n");
printf(" A B C D E F G H\n\n");

printf("Position Zobrist: %" PRIu64 "\n\n", board->zhash_key);
printf("Zobrist hash key for position: %" PRIu64 "\n\n", board->zhash_key);
}

int main(int argc, char *argv[]) {
Expand Down

0 comments on commit 07643f0

Please sign in to comment.