AWARI 1.1 For the HP48sx By Garth Sweet Copyright Jan. 1993 AWARI is a game based on the ancient African game of the same name, it was originally played on a wood or stone board made with 14 holes or 'buckets' in it. In 12 of the buckets were placed 36 stones (3 per bucket), the idea of the game was to move stones from the 12 filled buckets to your home bucket (one of the 2 empty ones). AWARI for the HP48 replaces the wooden board and 36 stones with the LCD screen, the board is drawn out onscreen as it wouldv'e appeared in wood. Below is a simple ASCII representation of the board, to try and show how the board is laid out. /---\ /---\ /---\ /---\ /---\ /---\ | 3 | | 3 | | 3 | | 3 | | 3 | | 3 | /---\ \---/ \---/ \---/ \---/ \---/ \---/ /---\ | | | | | 0 | A B C D E F | 0 | | | | | \---/ /---\ /---\ /---\ /---\ /---\ /---\ \---/ | 3 | | 3 | | 3 | | 3 | | 3 | | 3 | \---/ \---/ \---/ \---/ \---/ \---/ The game requires two players, (although the HP48 can play one of them) and each player gets one row of buckets plus an end bucket as thier own. Player 1 gets the top row plus the leftmost bucket, player 2 gets the bottom row plus the rightmost bucket. To play, a player selects a bucket (by pressing a key A-F) and the computer will take all the stones from that bucket, and place one in the bucket next to it, then one in the next, and so on until there are no more stones to drop (play moves counterclockwise). Each bucket originally starts out with 3 stones in it, and the home's have none. If for instance then player 1's 1st move was to move the stones from bucket B (which would contain 3 stones). Then after selecting B, the HP will add 1 stone to A (making 4 in A), 1 stone to home (making 1 in home) and add wrap around and add one to player 2's A bucket (making 4 in player 2's A bucket). The idea is to get as many stones into your home bucket this way as possible, the game ends when any player can't play (thier side is out of stones) or any buckets has more then 18 stones (at that point someone has more then half the available stones so they are guaranteed the win). But there are also a couple of other rules to add a twist to the game, the 1st is that when a player is taking a turn, if they make a move that results in the last stone being dropped into thier own home, they get to go again (but only once per turn). The 2nd rule is that if the last stone being dropped is going into an empty bucket, and there are stones in the bucket immediately across from it, then the one stone plus all the stones in the bucket across go to your home. The rules are simple really, just play once or twice and you'll have the idea. AWARI comes in the form of a library, to set it up, do the following: 1. Download the library to the home directory of the HP48 2. RCL the library to the stack ( 'AWARI' [RCL] ) 3. Type ':0:1160 [STO]' 4. Purge the AWARI library from the VAR menu ( 'AWARI' [PURGE] ) 5. Turn the HP off and then on. When you go to the library menu, there should be an AWARI directory there, go to that directory and select AWARI. AWARI takes up about 6K of memory, and is written in User RPL, this makes it a little slow, perhaps, but not really, it's quite fast. There are also two utilties that the library uses, and make be useful to you aswell, they are GETS and PUTS, they work EXACTLY like GETI and PUTI only they don't increment the counter, this means that after a PUT you still have the counter on that stack of where you did the PUT at. The two utilties will be useable in any program you write, so long as the library is attached. Enjoy! CHANGES TO 1.1: - Pressing the BACKSPACE key will switch AWARI into an 'auto finish' mode, the HP48 will automatically make the best (most point gaining) move for each player. This makes it nice for when you can tell who's going to win and don't want to go through the motions. - Pressing ATTN to exit cleans up the stack completly. - On ending AWARI leaves you in the LIB menu, not the VAR menu. - Fixed virtually un-noticed key bug. - Made game board symetrical. (Oops!) Notes: This is the 1st library I've released, and while it works well on my HP, I can't guarantee it at all for anyone else's. In particular, I don't know if the library ID I picked is already used by another program in circulation. If anyone has any problems I would certainly be glad to hear of them, I'd like to make sure the program is fully bug-free. This software is released as use at your own risk. This program is released into the Public Domain and is free to use and copy. How to contact the author: Write: Garth Sweet Comp. 34, Mayflower Ave. Lr. Sackville, N.S. B4C 2S6 Canada Phone: 902-865-8987 Email: sweet@ug.cs.dal.ca