|★ AMSTRAD CPC ★ GAMESLIST ★ OTHELLO|COMPUTING WITH THE AMSTRAD) (c) COMPUTING WITH THE AMSTRAD ★|
|Computing With The Amstrad|
ROBIN NIXON hauls a 19th century game into the computer age
OTHELLO couldn't be simpler - it's a game with only one rule. Easy to learn but very hard to play well, for the state of the board can change drastically after only one move.
This is, in fact, how Othello got its name. It was invented in England some time during the 19th century and was then forgotten until it was rediscovered in 1971 by Goro Hasegawa from Japan.
His father, who was a Shakespeare scholar, remarked on how there was a similarity between the sudden reversals of situation in Shakespeare's play and the game.
As with chess and draughts, Othello is played on an 8 x 8 board with the exception that all the squares are the same colour. The counters are double sided, usually black on one side and white on the other, with each player having a different colour.
At the start of each game the players place four counters at the centre of the board (see Figure I).
Thereafter they take it in turns to place a counter with their own colour face up on an empty square in such a way that there is at least one counter of the opposite colour sandwiched between it and another of the player s own colour, in either a horizontal, vertical or diagonal direction.
All the opponent's sandwiched counters are then turned over to become the player's colour. It is possible for a player to sandwich the opponent's counters in several directions with one move (see Figure lla). In such a case all sandwiched counters are turned (Figure llb). A player must always turn over at least one of the opponent's counters. If this is not possible the move is forfeited.
The game continues until the board has been filled, one or the other player has no counters left on the board, or neither player can move. The winner is the one with the most counters of their own colour.
As the object of Othello is to end up with the greatest number of counters of your own colour, it can be very tempting to try and turn over as many of your opponent's pieces as possible right from the start. However this can be very dangerous, because during the opening and middle game the more counters you have and the less your opponent has, the more options are left open to your opponent (see Figure III).
After a few games you soon realise that the state of the board can change completely during the last eight or so moves. It therefore becomes apparent that certain squares have a higher strategic value, while others can be very dangerous.
The strongest positions are the corners, because once gained a counter on a corner cannot be turned over and neither can counters of the same colour placed either side (see Figure IV) So corners can become a solid base from which to launch an offensive.
The sides are also very strong, as counters placed there can only be turned over in one direction and can be used to turn over counters of the opposite colour in three directions (Figures Va and Vb).
In implementing Othello on a computer it would be possible to construct an algorithm that searched several moves ahead. However the time taken to compute each move could be several hours.
Of course this would become a lot less if the program were written in Assembler.
One way to overcome this problem is to construct a table of weightings showing which positions are stronger than others (see Figure VI). This table can be updated as play continues and positions that were weak become strong and vice versa.
Another strategy worth adopting is to prevent the computer from turning over too many counters at the beginning of the game, leaving a large number of possible moves available, while during the endgame choosing moves that turn over the largest number of counters.
These two strategies together enable the computer to play a reasonably advanced game taking only 1 5 seconds a move on the easy level and less than two minutes a move on the hard level.
If you are an experienced Othello player you might like to try experimenting with altering the table of weightings (lines 210-290) or the amount by which the weightings are adjusted when a corner move is being made (lines 1660-1690).
You could also write a subroutine to adjust the weighting when a side move is made or alter the down level subroutine to look two or more moves ahead instead of one.
This version of Othello requires only two keys, as the computer works out all your possible moves before asking for an input.
The Spacebar is used to scan between possible moves and Enter selects or enters a move. This saves having to type in coordinates, helps you not to miss a move and avoids the need to check for an illegal move.
L'alinéa 8 de l'article L122-5 du Code de la propriété intellectuelle explique que « Lorsque l'œuvre a été divulguée, l'auteur ne peut interdire la reproduction d'une œuvre et sa représentation effectuées à des fins de conservation ou destinées à préserver les conditions de sa consultation à des fins de recherche ou détudes privées par des particuliers, dans les locaux de l'établissement et sur des terminaux dédiés par des bibliothèques accessibles au public, par des musées ou par des services d'archives, sous réserve que ceux-ci ne recherchent aucun avantage économique ou commercial ». Pas de problème donc pour nous!
CPCrulez[Content Management System] v8.7-desktop/cache
L'Amstrad CPC est une machine 8 bits à base d'un Z80 à 4MHz. Le premier de la gamme fut le CPC 464 en 1984, équipé d'un lecteur de cassettes intégré il se plaçait en concurrent du Commodore C64 beaucoup plus compliqué à utiliser et plus cher. Ce fut un réel succès et sorti cette même années le CPC 664 équipé d'un lecteur de disquettes trois pouces intégré. Sa vie fut de courte durée puisqu'en 1985 il fut remplacé par le CPC 6128 qui était plus compact, plus soigné et surtout qui avait 128Ko de RAM au lieu de 64Ko.