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 Search Algorithm

 

The Search Algorthm


I use a standard negascout search, with very limited move ordering based on the most recent cut-off at each depth.

That probably means nothing to you

I'd like to take you through the evolution of a search algorithm, however various people have done this aready as search techniques are pretty standard.

Search Trees


Search trees are a useful way of thinking about how a game progresses. Consider a hypothetical simple game where there are only two possible moves available at each turn. At the root of the tree, i.e. the first turn, we have two possible moves. After each of these moves, there are two more possible moves (so four possible positions the board can be in after two moves). After three moves we have eight possible outcomes, and so on.
We could happily map every single possible state in chess, if we had the time and storage space. But even in our simple game, after 16 moves we have 65536 different states, this shows how large search trees can quickly become. Chess has on average thirty or so possible moves each turn. That's an awfully large search space.

Min-Max


Min-max is one of the basic techniques used in two player game AI. It basically corresponds to the first player trying to minimise the opponents score, and the second player trying to maximise theirs. The score can be just an estimate for a position to allow us to look ahead a certain depth, without needing to evaluate the whole search space.
ai-depot.com has a nice description of min-max and alpha beta pruning.

Alpha-Beta pruning



Windowing and move ordering


Negascout



More info to follow, however try a web search on any of the tems, I'm sure you'll find something interesting.


Back to: The Rating Algorithm

Show Topic: The Program

Next Page: Putting it all together