You all know Othello, dont you? Some of you may know it as Reversi but it’s essentially the same thing. Well for those of you not old enough or just not into old games, lets have a background check:
Othello: The Board.
(picture rights – Robert Gatliff: original webpage)
Othello is played on an 8×8 board (64 playable positions on the grid – 4 taken up by initial piece placement at the center), is played by two opponents, first player has the black pieces while the second has the white pieces (in contrast to chess).
The game starts with four pieces already placed on the board. For reasons of clarity we will denote the columns and rows by numbers (columns over rows, columns/rows). Positions 4/4 and 5/5 each has a white piece and positions 4/5 and 5/4 each has a black piece.
As already said, blacks attack first.
Othello: Laws in Motion.
A new piece can be placed in any position on the board that fulfills the following conditions:
1. The new position X, where player P is placing the new piece, needs to be blank.
2. In at least one of X’s adjacent positions, there is one of the opponent’s pieces.
3. There needs to be at least one straight line made up of the opponent’s pieces, starting at any position adjacent to X and terminating at a position which has one of the current player’s pieces.
To illustrate:
– | – | – | – |
– | white | black | – |
– | black | white | – |
– | – | – | – |
On the segment of the board above, we see the initial placement of pieces (that means, we’re looking at positions 4/4, 4/5, 5/4, 5/5 – and one adjacent blank column and row).
Since no other movement has been made, the game is starting now and so, the first player (black pieces) is expected to place a new piece on the board.
Checking the rules of the game above, the only legal positions for the first player are as follows:
1. First line at 2/1, above the white piece (blank position, there’s at least one of the opponent’s pieces adjacent to that position at 2/2 and there’s one of the player’s own pieces at the end of the straight line starting at 2/1 and terminating with one of the current player’s positions at 2/3).
The same explanation holds for the following legal positions:
2. Second line, first column
3. third line, fourth column
4. fourth line third column
As soon as a new piece is placed on the board the following happens:
– The straight lines formed by the new position X and all positions Y where there already exists one of the player’s pieces, are all won over (that means that white pieces in between will turn black, and vice versa depending on whose turn it is)
In our example, if the first player decided to place the new piece at 2/1, the second column would be won over and the result would be:
– | black | – | – |
– | black | black | – |
– | black | white | – |
– | – | – | – |
The board consists of 64 positions. As soon as one of the players runs out of legal moves, the game ends and the player covering the larger part of the board is considered the winner (the player with the most pieces on the board).
Othello: Why Bother.
The game can be played by any person who can grasp the three rules stated above (although i can already come up with a list of ex-collegues who cant even do that) …
However, Othello is not a trivial game. In fact, Othello -or Reversi if you prefer- is a deep strategic game that involves a lot of thinking and look-ahead techniques and revolves around a number of strategic algorithms that will maximize one’s chances of winning.
As such, the game is considered a popular (among others) first attempts for programmatic development (although i’m just making this up to explain why i decided to go ahead and do it -lol).
In my next posts, I will explain exactly how I’m going through the development of the game, using Visual Studio 2008 and programming in C#. Don’t go on thinking it’ll be a full windows application. As already said, I’m only doing this to develop my algorithmic approaches and to figure out how Object Oriented programming goes about.
Stay tuned for the next post 🙂