ChAmiChkrs: Chinese Checkers By Vidhyanath Rao ---------------------------- This documentation includes technical material indicative of the caring approach the author has taken to the creation of the program. If you don't care for technical notes, just try the program first, learn what you can, then return here for any more information you might need. In essence, you'll be playing a game you've probably played before. The docs reveal the complex levels of thought that went into this computerized version and are well worth reading.) This is an Amiga version of the game Chinese Checkers. It works only in the six-player version of the game, with the effect that one human player can take part in a six-way game involving five computer opponents. There are two justifications I can offer: First, there seem to be enough "me versus it" games. Second, though the computer can play more than one side, it does not let them "collude" with each other. So you can always let the program play all the sides that no one else is handling. Except for the lack of a color requester and the need for "arp.library" to have a file requester, it is fairly well "Intuitionized." When you start the game you will see an eight-color, low-resolution custom screen. There is only one window on this screen, and the window is borderless. Messages appear on the right hand side of the window. The board appears on the left. When the program starts, it looks for a file named "Configure.CAC" in the directory from which it was invoked. The configuration file must have at least two lines. The first line must have the following form: n m x yyyyyy . . . where n is a digit between 1 and 6 that specifies the player who starts the game. Then comes a space followed by another digit 'm' between 1 and 5. This sets the play level. Next is a space followed by one of '@', 'B' and 'C'. This specifies the variation on the game that is to be played. See below under the rules. Finally, there should be six letters, each of which is either 'A' or 'H'. 'A' says that that side is played by the computer; 'H' means that the human player(s) will handle that side. The second line specifies the colors used. It must have the following format: 0rgb 0rgb 0rgb 0rgb 0rgb 0rgb 0rgb 0rgb . . . eight numbers which specify the eight colors. The first color is the background, the fifth is used for other background drawing. The other six colors are used to render the "marbles" used in the game. The r, g and b stand for hexadecimal digits [0-9, 'a'-'f'] that give the relative amounts of red, green and blue in these colors. The default uses the basic colors: black, red, green, blue, white, cyan, magenta and yellow. You will see three menus in the screen. These are "GAME", "Amiga Plays" and "MOVE". The items in the "GAME" menu are "quit", "new" [new game], "load" and "save". The actions should be self-explanatory. If you have "arp.library" the ARP file requester will appear when you save or load a game. If you don't have the ARP library, you cannot choose the file name. When you save a game, the file will be named "SavedGame.CAC". If you have another saved game, you should rename that file, using the WorkBench "Rename" menu item. Again, if you don't have the ARP library, and you select the "LOAD" menu item, the program will look for a file named "SavedGame.CAC" and load that. If you have renamed the file you wish to load, you will have to change the name again. The second menu allows you to set the colors the Amiga will play. These are toggles. If you choose a selected item, it will become unselected. The items the computer plays are indicated by the checkmark. The computer does not collude with itself. It acts as if all the players it plays for are playing independently. The items in the "MOVE" menu are "hint", "undo", "replay", "variant" and "level". The first gives the move the computer will choose if it were playing that side. The next takes back moves; select this as many times as there are plays that you want to undo. The "replay" item will show the last move once more. The "level" item has five subitems. These select the level of the computer's play. The selected level is checkmarked. The "variant" item has three subitems called "normal", "back ok" and "long ok". The first allows only Checkers type jumps in the moves. The second will allow backward jumps as well. "long ok" allows "long jumps". See the rules section for a longer explanation of what this means. To make your move, click on the marble you are going to play. Then click at the point where this marble is to be placed. If you select a marble and then change your mind, click on that marble again. This will deselect that marble. If the move is illegal, you will see a message to that effect appear in the right side of the screen. Otherwise, the computer selects some sequence of jumps to achieve this move, and shows that by flashing a marble at each point of this sequence. This flashing is done sequentially. If it is the computer's turn to play, it will chose a move and show it by flashing. Note that no attempt is made to chose the most efficient choice of jumps. So the marble may travel all over the board even if there is a single jump to get where ever it is going. Like most board games in their first implementation, the end-game play is weak. Of course, this improves your chance of winning. Call it a feature and not a bug. RULES: For those who might be unfamiliar with this game, I have included a brief description: This game is for up to six players. The board has the shape of a six-pointed star. Each player has 10 "marbles" arranged as a triangle culminating at one of the points of the star. The aim of the game is to move all your marbles to the triangle on the diagonally opposite corner of the board. Each of these triangles is given a different color. The same six colors are used for the play pieces. I call them "marbles" out of habit. A hexagonal grid is marked on the board. The points where these lines intersect are the points where marbles are placed. I will call them "cells". At the beginning of the game, each marble is in the triangle that has the same color as itself. There are two kinds of moves: In the first type, a player can move one of his marbles to one of the six adjacent cells, provided it is empty. Also, the cell moved to must be in the triangle of the same color as the marble, or the opposite triangle, or the central hexagon. The other type of move consists of a sequence of jumps. "Short jumps" are allowed in all three versions of the game: A short jump is like a jump in checkers: If there is a marble (anyone's, including your own) next to you, and the next cell in that line is empty, you can jump that marble. However, you don't remove the marble you jump. Thus there are always 60 marbles on the board. In the second version of the game, selected by the "back ok" subitem of the "variant" menu, you may mix in backward jumps. So you may jump backward and forward in any order you choose. The third version allows long jumps. If there are "n" empty cells between your marble and another marble, and (n+1) empty cells on the other side, you may move to this last cell. Here are some examples of long jumps: Here M is the marble moved, C is some marble and E is an empty cell; X means we don't care: M E E C E E E ---> E E E C E E M [complicated] P, Q, R, S are also empty. R E M C E E S | |E E E C E E M [ M first jumps to P, then to Q, C X C X X X |--->| C X C X X X [ then to R, and finally to S. ] Q C P X X X | |E C E X X X If you find this confusing, let the computer play all the six sides and watch. You should be able understand what "long jumps" are. Color restrictions mentioned earlier apply at the end of the sequence of jumps. But you may go into any outer triangle, provided you come out in the same move. You can make any number of jumps, but may not mix the two types of moves. That is, if you start with a jump, you cannot take a step in that move. If you take a step at the start of a move, that is the move. 3]FORMAT OF THE SAVE FILE The save file has a header made of one line, followed by a number of lines, each line listing one move. The header line has the same format and meaning as the first line in the configuration file. The lines that list the moves look like this: 1C: ( 4, 2)-( 2, 2) The first character gives the player number. It is between 1 and 6. The second character identifies the marble. It is a letter between A and J inclusive. Then come a colon and a space. They are followed by a number of points identified by coordinates separated by hyphens. The coordinate system used is non-orthogonal. It consists of the line across the middle of the board, and the line making an angle of 60 degrees clockwise with the first axis. These points are the cells that form the path of the move made. Enjoy, and send your comments, suggestions and bug reports to: Vidhyanath Rao, 7686 Springrun Ct., Reynoldsburg, OH 43055, or on InterNet to vkr@osupyr.mps.ohio-state.edu