HTTP-Othello
The complete state of the game is encoded in the URL after the "/" character.
This means that no information about the state of the game whatsoever is stored
at our WWW site. Also, you can undo moves with the Back button of
your WWW browser. Your browser may even indicate which move you took last time
in the same situation.
What's in that URL ?
The "/" (and everything before it) is not
important.
The first digit after the "/" is either 0 or 1:
- 0 Human player plays black (black makes the first move).
- 1 Computer plays black.
The second digit contains the playing
level.
All subsequent characters denote the moves that have been played. Every pair
of characters denotes one move. The first character of a pair indicates the
color of the player, this character is either a "+" or a "-":
- + Black played the move.
- - White played the move.
Normally the "+" and "-" moves alternate,
unless a player could not make a move at some point.
The second character
encodes one of the 64 fields of the board. The encoding method is rather
awkward.
In all WWW browsers it is possible to edit the current URL. In this
way you can undo several moves, or force my program to play moves that the
move-evaluator would never select. If you add an illegal move to the list, the
program will signal this.
The fields that are legal to play trigger an URL that adds one move to the
list. Most WWW browsers show the URL of an anchor when the cursor is positioned
over it.
The fields that are not legal to play trigger an URL that explains
that that field can not be played and how playable fields can be recognized.
Random moves
In some cases the move-evaluator of my program finds
several moves that are equally attractive. In such cases it makes a random
choice. If you use the Reload button of your WWW browser, the
program may select an other move, thus not producing the same screen. This is a
feature, not a bug.
No legal move - forfeit
When the program detects that there is no legal
move (and the board is not full) the other player gets another turn. If the
other player cannot play either, the game ends.
If the program plays a move after which the human player must forfeit, the
program makes another move (after which it is possible that the human player
must forfeit again. The program continues playing until one of the following is
true:
- There is again a legal move for the human player.
- The board becomes full.
- There neither player can make a legal move.
In the last two cases
the game ends.
The graphics
The board is built up using four different graphics files:
- A white empty field (can not be played) (may not be visible on your screen)
- A dotted empty field (can be played)
- A field with a black disk
- A field with a white disk
The graphics were created with MacDraw 2
on an Apple Macintosh computer and later converted to ".gif" files. All WWW
browsers detect it when the same graphic image is used again. Therefore those
four images are usually transmitted once.
Because the fields are used as anchors (pointers to URLs) the WWW browser
draws a (usually) light blue line around it. The thickness of this line may vary
with the particular WWW browser. To prevent any problems with the alignment of
the fields, all fields are anchors, even those that do not represent a
legal move.
All non-playable fields contain the same anchor. Therefore when
you've clicked once on an unplayable field (and got the "This is not a legal
move" message) those anchors will suddenly all have the color for a followed
link (usually a dark blue line) around them. This highlights the legal moves
even better.