ANTIC VOL. 7, NO. 9 / JANUARY 1989 / PAGE 14
By Edward Brown
Happyface Reversi puts a smile on your squares as you battle to convert the playing board to your color. For one or two players. This BASIC program works on 8-bit Atari computers with at least 48K memory, disk or cassette.
Happyface Reversi is a challenging computerized version of the old board game Reversi, wbich was recently re-popularized under the name "Othello." You can play against your hard-to-beat Atari, watch your Atari play against itself, or take on a human opponent, setting as many four levels of handicaps if you wish.
The object of Reversi is to cover the majority of squares on an 8 x 8 board with pieces in your own color, outflanking rows of your opponent's pieces and reversing them into your color. The player who has the most squares at the end of the game wins. (A tie of 32 squares apiece is also possible.)
Just for fun, and for a slightly unusual graphic look, I put a different version of the overly familiar happyface logo into each of the two opposing colored teams of squares. When you reverse a square's color, you also change its happyface smile.
Here's how it works. The main program loop begins at line 1535. Computer moves are determined in the large subroutine starting at line 660 by maintaining a VALUE matrix of the desirability of each position on the board. The Happyface Reversi program searches for the most desirable legal move available using this matrix and the current board positions.
Happyface Reversi now draws the playing board onscreen and sets up the initial positions, including handicap corners. Purple always moves first and is controlled by a joystick plugged into port 1. Green is controlled by a joystick in port 2. The colored arrows on the sides of the screen indicate which player has the next move.
Move the white cursor to the desired square on the board and press the joystick button. If you attempt an illegal move, the computer will buzz. If you have no legal move, press the [SPACEBAR] to pass on your turn.
To legally outflank your opponent, place your pieces on the board so that your color is on both ends of a row of your opponent's pieces, or on opposite sides of an opponent 5 single piece. All of the outflanked pieces will be changed to your color and your happyface. Any number of pieces can be outflanked with one move, in any direction including diagonally, and even in more than one row. To really get the hang of Reversi, set the computer to play against itself and observe the moves.
Players alternate moving single pieces until all 64 squares are occupied, or till neither player has a legal move, or till all pieces on the board are of the same color. The player with the most squares wins. The final score is displayed at the bottom of the screen and the borders of the board flash the victor's color. To start a new game, hold down either joystick button.
You can switch player control between human and computer in the middle of a game by pressing [OPTION] or [SELECT] or [START] after a prompt, or while the program is waiting for joystick movement.
The move that outflanks the largest number of opponent's pieces is not always necessarily the best move. Smaller strategic moves can often give a big payoff later in the game.
Ed Brown is a computer science major at Indiana-Purdue University. His first Antic appearance was in December 1984.
LISTING: REVERSI.BAS