About this Applet
Is it Reversi or Othello?
From what I've read Reversi is the original name of the game. Othello
was the name under which first commercial boards were marketed. Because
I first learned this game as Reversi I am more comfortable with
this name. But because most of the other people know this game as
Othello I have to use this term as well to be universally understood.
I am sorry if my inconsistency causes even more confusion.
Apparently the algorithm I used has a scientific name. It is called
MiniMax and you can learn more about it at here
The maximum depth of search at which my computer responds in a reasonable
time is 4 for Netscape Communicator running on Pentium 90 machine. Depth
of search can be changed before each move.
At the end of the game the number of possible positions dramatically decreases and the
evaluation criteria is also much more simple: who has more disks wins. This allows the program
to calculate moves at much greater depth. When playing at depth 1 the end of game search
starts when there are 56 disks on the board, for depth 2 it starts at 55 disks, for depth 3 at 54, etc.
In other words end of game depth is determined by the following formula:
end_of_game_depth = 8 + selected_depth_level
Sometimes transition from regular search to end of game search isn't very smooth and there may be
a noticeable delay when computer calculates end of game positions for the first time.
The evaluation function which is used to determine the best possible
move is assigning credits for mobility and corners and deducts credits
for playing bad squares (follow this link
for explanation of Othello strategies)
In two respects my algorithm is different from some others that I reviewed.
Firstly, it doesn't assign mobility credit for moves that result in taking
"bad" squares. Secondly, C and X squares are no longer considered
"bad" when the corresponding corner is taken. Moreover, the static
evaluation function assures that at this point in the game C-squares start
to look very attractive.
Whether these features improve the quality of the game or not I cannot
tell, because I am not a good player. But the applet currently plays
far beyond my abilities and therefore I think I did a good job.
I believe that the strength of the game can be somewhat improved by
optimizing the values of credits and debits assigned for mobility,
corners and bad squares. I couldn't find any research materials that
would discuss this kind of optimization. If you are aware of such
research or can suggest the optimization algorithm, or know of a self-learning
Othello programs that are capable to adjust parameters based on the outcome
of the games - please share the information.
On the technical side the game implemented as a good illustration to
OO design textbooks. It is based on Smalltalk-style Model-View-Controller
pattern where Model, View and Controller components are connected using
Observable pattern (see "Design Patterns" by Eric Gamma et al.).
The game is multithreaded. Refreshing of the screen, computer calculations,
handling of user input, animations, loading of sound and other non-crucial
files and timer implemented in separate threads.
In the foundation of the design is class Position which is responsible
for calculating value of a position and determining available moves.
Class Game controls the game flow by scheduling user and computer moves.
Class ReversiView provides applet shell and determines the UI. Finally,
class ReversiController is responsible for updating ReversiView based on
the state of the Game and informing Game about actions of the human player.
Other Reversi Links