Entries by Steve Maughan

The Beauty of Bitboards

I really am enjoying coding Maverick using bitboards.  Yesterday I stumbled across a neat way to handle en-passant move generation. moves = (((board->piecelist[piece] > 16 * to_move) & B8H1) & (board->occupied[opponent] | board->ep_square); The term “board->ep_square” is a bitboard holding the en-passant target capture square.  The last “or” instruction fools the move generation routine into […]

Writing Color Blind Chess Code

Back in 1999 I created the first version of Monarch in Delphi.  At that time I wondered just how fast the Delphi code would be.  Would it be able to compete with the then rapidly improving C compilers.  So I wanted my code to be as fast as possible.  While the debate over brute force […]

Generating Magic Multipliers

I finally cracked the process needed to generate magic multipliers.  I didn’t find it trivial.  Here are necessary steps: 1. Create Combination Table: When generating magic moves the first step is to logically AND the board with the relevant square’s mask.  Let’s use the rook on e5 in the diagram below as an example: The […]

Automatic Tuning of a Chess Evaluation Function

I’ve taken a little detour over the past week to look at Population Based Incremental Tuning.  This was something which Thomas Petzke brought to my attention.  You can read his take here: http://macechess.blogspot.com/2013/03/population-based-incremental-learning.html It’s an interesting approach.  After some investigation I’ve decide to add some form of automated tuning to Maverick’s chess position evaluation function.  […]

Bitboards Magic Number Research

I’ve quite happy with the global list of possible move.  Now I need to turn my attention to move generation.  For the pieces which don’t slide (i.e. pawns, knight and kings) this is trivial.  For sliding pieces I’m going to use the “new kid on the algorithmic block” – Magic Bitboards.  I’m in the process […]

Are There 65,884 Legal Chess Moves?

I’ve finished creating the global move list.  This list contains all legal chess moves (e.g. one move might be white bishop on g2 captures black queen on d5).  It would seem there are 65,884 possible legal moves!  Does anyone know if this is indeed correct? EDIT: It looks like my first attempt was off.  After […]

Refining the Piece Index Values

I’ve been thinking about the piece index values.  The original set had all of the pieces in a random list.  I think there is an advantage in having the following piece index values: #define WHITE 0 #define BLACK 1 #define KNIGHT 1 #define BISHOP 2 #define ROOK 3 #define QUEEN 4 #define PAWN 5 #define […]

Global Move List

In the first version of Monarch I used an Exhaustive Global List of Chess Moves.  This is a list of about (from memory), 47k moves which collectively describe all possible moves on the chess board.  So an example of one move might be white Bishop on b2 takes black Rook on e5.  This will be […]

When Will Maverick be “Launched”?

I see over on CCC Pawel Koziol has launched Rodent 1.0. Big Congrats! I was intrigued by Pawel’s “launch criteria” (i.e. 1.0 status).  He says he would only go to “1.0” status when Rodent beat Fruit 2.1 in a 100 game match.  This is an interesting criteria for launching a chess engine! It got me thinking! So […]