Andy's LEGO® Mindstorms® Page
About this site
  
What's New?
  
Standard Disclaimer
Quite C
  
Francesco Ferrara
  
Getting Started
  
Installing Quite C
  
Compiling a project
  
Sample Code
Chess
  
The Robot Chess Project
  
Programming Chess
  
First Attempt
  
Version 0
  
Version 1
  
The Program
  
The State of Play
  
The User Interface
  
The Move Generator
  
The Move Applier
  
The Rating Algorithm
  
The Search Algorithm
  
Putting it all together
  
The Robot
  
The Head
  
Moving the head
  
Movies
  
Downloads: Source Executables, MLCad Models
4-in-a-Robot
  
4-in-a-Robot - the Robot
  
The 4-in-a-Robot Base
  
The 4-in-a-Robot Delivery Mechanism
  
The 4-in-a-Robot Controller
  
4-in-a-Robot - the Code
  
The 4-in-a-Robot Algorithm
  
The 4-in-a-Robot Control Programming
  
The 4-in-a-Robot Robot-less version
  
Installing 4-in-a-robot
  
Playing the robotless 4-in-a-robot
  
View the source code
Speech
  
The problems with speech
  
Sounds familiar
  
H8 Timers Background
  
Trial and Error
  
Volume Zapper
  
Actually Speaking
  
Speak.c - the code
  
The VB code generator
Some ideas for the future
  
Room positioning robot
  
Neural Net Bot
  
Pianola
  
Text to speech
LEGO® Mindstorms® Links

[268745]

The Program

 

Anatomy of a chess program


Most chess programs can be broken down into several key components:

  • The State - where all the pieces are, who's go it is, castling, en-passant, 50 move draw, and move history for 3 repetitions

  • The User Interface - input/output of moves

  • The Move Generator - given the state of a game, returns all possible legal moves

  • The Move Applier - given the state of a game and a move, returns the new state of the game. There is often a reverse function to undo a move and revert the current state back to the state it was before the move was played

  • The Rating Algorithm - given the state of a game, returns a score indicating who is winning and by how much. This is different for each chess program and governs the strength and style of the computer player

  • The Search Algorithm - given a state of a game, searches for the best move which can be played. There are several different algorithms, which govern the speed the computer can work out its best move, and how far ahead the computer can search



I'll attempt to describe how I've implemented each section and the problems and solutions I've encountered at each stage.

Please bear with me as I get these sections written over the coming weeks.
The State of Play
The User Interface
The Move Generator
The Move Applier
The Rating Algorithm
The Search Algorithm
Putting it all together


Back to: The Robot Chess Project

Show Topic: Chess

Next Page: The Robot