At the forefront of Artificial Intelligence
  Home Articles Reviews Interviews JDK Glossary Features Discussion Search
Home » Articles » Gaming » Projects

Othello Project

By Robert Lange

Othello (aka Reversi) is a "grown-up" game like chess or go, yet it is easy to program due to its small rule set. This makes it a good starting point if you want to get into advanced board game programming.

Outline

  • Goal: To control the majority of the board by the end of the game.

  • Setup: Two-player, turn-based game played on an 8 x 8 board. Initially the board is set up as shown in Figure 1. Black always moves first.

  • Movement: Moves consist of "outflanking" your opponent's discs, then flipping the outflanked discs to your colour. To outflank means to place a disc on the board so that your opponent's row of discs is bordered at each end by a disc of your colour (row - one or more adjacend discs in a straight line). Figure 2 shows an example: The black disc 1 was already in place on the board. The placement of black disc 2 outflanks the row of two white discs.
[board setup]
Figure 1
[movement]
Figure 2
    If on your turn you cannot outflank at least one opposing disc, your turn is forfeited and your opponent moves again. When it is no longer possible for either player to move, the game is over. Discs are counted and the player with the majority of discs wins. Note that it is possible for a game to end before all 64 squares are filled.

    The complete rules and other information about Othello can be found at the IIOA website.

Guidelines

In order to play with resonable strength your AI agent will need to "think" several moves ahead. Therefore use minimax search, combined with alpha-beta-pruning, in your program. If you are not yet familiar with these techniques, read these lecture notes on board game programming.

Heuristics you might consider when evaluating moves/board positions:

  • Material: Number of your discs vs number of your opponent's discs.
  • Mobility: It is usually favourable to have many possible moves to choose.
  • Corners: Connected discs at the corners are especially valuable since they cannot be taken.
  • Threats: Is somebody going to take a corner?
If sensibly combined these should produce quite a capable opponent.

- Robert Lange


Solutions

othello-av.zip (57Kb) Solution submitted by Antoine Villepreux. A Visual C++ 7.0 solution utilizing a minimax tree pruning algorithm.

Last Updated: 26/07/2003

Article content copyright © Robert Lange, 2003.
 Article Toolbar
Print
BibTeX entry

Search

Latest News
- Generation5 10-year Anniversary (03/09/2008)
- New Generation5 Design! (09/04/2007)
- Happy New Year 2007 (02/01/2007)
- Where has Generation5 Gone?! (04/11/2005)
- NeuroEvolving Robotic Operatives (NERO) (25/06/2005)

What's New?
- Back-propagation using the Generation5 JDK (07/04/2008)
- Hough Transforms (02/01/2008)
- Kohonen-based Image Analysis using the Generation5 JDK (11/12/2007)
- Modelling Bacterium using the JDK (19/03/2007)
- Modelling Bacterium using the JDK (19/03/2007)


All content copyright © 1998-2007, Generation5 unless otherwise noted.
- Privacy Policy - Legal - Terms of Use -