Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!uunet!munnari.oz.au!brolga!uqcspe!batserver.cs.uq.oz.au!grue From: grue@batserver.cs.uq.oz.au (Frobozz) Newsgroups: comp.sys.handhelds Subject: Re: Reversi for the HP48SX (Machine code version) Keywords: reversi Message-ID: <6514@uqcspe.cs.uq.oz.au> Date: 24 Dec 90 03:15:12 GMT References: <6479@uqcspe.cs.uq.oz.au> <27740d10:1481.1comp.sys.handhelds;1@hpcvbbs.UUCP> Sender: news@uqcspe.cs.uq.oz.au Reply-To: grue@batserver.cs.uq.oz.au Lines: 98 In <27740d10:1481.1comp.sys.handhelds;1@hpcvbbs.UUCP> akcs.falco@hpcvbbs.UUCP (Andrey Dolgachev) writes: >I was thinking of two improvements: A two-player option on one >calculator, and a two-player option through the i/o. The two-player >option is obviously not hard at all, since the programs are virtually >there already. The i/o option is a little harder, but I have already >made a two-player tank arcade game thorugh the i-red, so it shouldn't be >too hard to do either. Well, hopefully, I will get around to this, and >post it up, making sure I give credit to the original creator Well, I'm the creator and patching the program to play 2 player is very easy. The following version of play should do the trick... (Note, I don't have my 48 with me and I edited the original posting by HAND. You should also note that the following code has NOT be tested at all.) I'll briefly write about the changes needed. The routine PMOV lets the player enter a legal move. It then makes that move on the board and changes the colour to move. By calling PMOV repeatedly the player will get to enter lots of moves of alternating colour. This works because the move checker uses the colour to move from the board string as does the move maker routine (for interests sake, it is located in the 5th nibble of the board description string, get it using BD 5 R->S GETN). So, all that has to be changed is to remove the you first message at the start and to also remove the bit of code which checks the colour to move and calls PMOV or CMOV as necessary. To make it nicer, it might be sensible to copy PMOV into some other name and edit it so that it doesn't display 'Your move' at the bottom of the screen. Making it display player 1 / player 2 would be a very simple addition. in fact this bit of code should do the trick: BD 5 R->S GETN SWAP DROP 1 == "Player 2" "Player 1" IFTE Just plug that bit of code into the spot occupied by the "Your move" string in PMOV (or the copy of it, called PMV2? You'd also have to change the PMOV in the new version of play below into PMV2). I'd rename the patched version of PLAY into PL2 or some such, so that the one player game was still accessable. I personally don't care for the ir two player version. It would require too much work for the benifits gained. Enjoy... Pauli seeya Paul Dale | Internet/CSnet: grue@batserver.cs.uq.oz.au Dept of Computer Science| Bitnet: grue%batserver.cs.uq.oz.au@uunet.uu.net Uni of Qld | JANET: grue%batserver.cs.uq.oz.au@uk.ac.ukc Australia, 4072 | EAN: grue@batserver.cs.uq.oz | UUCP: uunet!munnari!batserver.cs.uq.oz!grue f4e6g4Qh4++ | JUNET: grue@batserver.cs.uq.oz.au PLAY \<< SETUP WHILE 1 FC?C REPEAT PMOV SCOR IF 8 FS?C THEN IF 2 FS? THEN 1 SF ELSE 2 SF END ELSE 2 CF IF CCT PCT + 64 == THEN 1 SF END END END IF 3 FC? THEN PCT CCT - IF DUP 0 < THEN "I win" ELSE IF DUP 0 > THEN "You win" ELSE "Draw" END END 1 DISS ABS "by " SWAP \->STR + " disks" + 4 DISS END CLEAN \>> --