|
Here- look at this picture to the right. In order for the playing pieces
(the two tokens and the two walls) to be in the positions shown, a player must have clicked on
each of the places indicated by a red dot. For the horizontal wall, the player clicked in the
space between the squares where he or she wanted the wall, and the wall blocks that column and
the one to the right. For the vertical wall, the wall blocks the row where the player clicked,
and the one directly above. (Note: these dots are not in the real game. They are shown here for
demonstration purposes only.) You can click in the area where potential walls intersect- but I
can't promise which wall will show up! Clicking anywhere between two squares places a wall, and
clicking anywhere within a square moves a token- if it is a valid move. (Once in awhile you may
attempt a move, and nothing will happen. Don't panic. Just try it again. Sometimes you're one
pixel off, and the game doesn't sense your click, and sometimes it just doesn't register. So try
again.)
|
|
There are two boxes of walls to the right of the board (one is shown to
the right of this explanation); these contain each player's remaining walls. The box on the
bottom holds the white token's walls, the box on the top holds the black token's walls. When
your box is empty- you can't place any more walls!
|
|
| start-game- which is set to true when a game
is initialized, and set to false when a game is finished. If it's false, no one is allowed
to move. This stops a player from moving around after a game has been won. |
| human1 & human2- which is true for each player that is a human,
and false for each player that the computer is playing. | |
turn- which stores whose turn it is. This is used
all over the place, to determine whose turn it is. (Oh, the cleverness of me!)
(That was sarcasm.) |
| pwent- which is true if it is a player's
turn, and that player has already gone. That's how the program knows when it's time to let
the other player have a turn. |
| current-wall- which holds an integer, which is inserted into the wall
arrays to represent walls placements. It is increased after each wall placement, to aid in
differentiating between walls... Here's why. Because a wall blocks two rows or columns, you
can't know which rows or columns belong to which wall, unless each wall has different numbers
storing its value... |
| nump1walls & nump2walls- which hold the number of walls that each
player has remaining. |
| path-keeper- which contains the array storing a player's path to his or her
goal |
| path-keeper-2- which contains the array storing a player's BEST path to his or
her goal |