A two-player chess variant set in space. The white and yellow fleets start on opposite edges of a red and black board, the pieces are drawn as spaceships, and white moves first. Squares are entered as a letter A–H followed by a number 1–8. On your turn you can make an ordinary move with M, which is checked for legality. W warps a ship into hyperspace, and it reappears later on a random square. F fires a plasma bolt at a neighbouring ship, B jumps a ship to a free starbase to restore its shields and bolts, and S shows a ship’s status, up to three times a turn. R resets the game and Q quits. Castling and en passant are not allowed, and the program does not announce check or checkmate.
The tape opens with a separate nine-page instruction program, chessdoc, which has its own font. It introduces the ships: the pawn is a scoutship, the knight a shuttle, the bishop a starship, the rook a stratocruiser, the queen a stardestroyer and the king a battleship. It also lists their bolts and shields and explains each command. At the end, A reads the pages again and L loads the game.
The game’s REM reads “HYPERCHESS DEC 1984 by CHRIS HOWARD STONE”. The game and its code file came from one Oliger disk and the instruction program from another.
Program Analysis
Board and Pieces
B(8,8) holds the pieces as codes 1–6 for white and 11–16 for yellow (scoutship, stratocruiser, shuttle, starship, stardestroyer, battleship). A(8,8) packs each ship’s condition into one number: the hundreds are the shield strength and the units are the plasma bolts. A scoutship starts at 202, a shuttle at 303, a stratocruiser or starship at 404, and a stardestroyer or battleship at 707. The first subscript is the lettered file, which runs across the screen. Yellow starts on files A and B and white on G and H, so the fleets face each other from left and right rather than top and bottom. Each square is 2×2 character cells, and each ship is a block of four UDGs. Line 30 points the UDG and CHARS system variables into the 5535-byte code file at 60000, which supplies the font and graphics. The game POKEs a set number into 61121 and calls USR 61000 before drawing each kind of ship, which appears to switch in that ship’s graphics. USR 63000, 63060, 63090 and 63200 are called when firing, moving, warping and re-entering, and appear to produce the effects for those events.
Commands
- Move: lines 2500–3230 check each piece’s move. The stratocruiser and starship routines step along the path with
FORloops to make sure it is clear, and the stardestroyer reuses both. You cannot move onto your own ship. A scoutship reaching the far file is promoted to a stardestroyer with full shields (lines 8300–8400). - Warp: the ship’s code and condition are pushed onto the arrays
H()andW(). Battleships cannot warp. - Re-entry (lines 8000–8230): after each command there is a one-in-four chance that a warped ship returns on a random square that is not a battleship’s. Whatever was on that square is replaced.
- Fire: the target must be within one square, and can even be the firing ship. Each shot uses one bolt and takes 100 off the target’s shield. Below 100 the ship explodes in an eight-frame animation and is removed.
- Base: the starbases are the queen and king starting squares (files A and H, ranks 4 and 5). A ship that jumps to a free starbase of its own side gets its starting shield and bolts back. Battleships cannot use them.
- Status: shows the ship’s name, location, shields and bolts, coloured green, yellow or red by strength. It does not end the turn.
The variable NEMO is set when a move, warp, shot or starbase jump completes, and line 8030 then passes the turn by flipping CLRTM between 10 (white) and 0 (yellow). Ownership is tested arithmetically with B(X,Y)-CLRTM.
Notable Techniques
- Computed
GO TOdispatch, such asGO TO 2310+10*NCPRfor the move checks andGO TO 9320+10*NCPRfor ship names. - Shield and bolt counts packed into a single array element, then separated with
INTarithmetic. POKE 23658,8turns on caps lock. The command and coordinate routines still accept either case.- The instruction program swaps the UDG pointer between two graphics sets in mid-page (lines 210 and 240) to show more ship pictures than 21 UDGs allow.
Potential Issues
- The instructions head the warp section (page 4) “R (RESET)” instead of “W (WARP)”.
- The instructions give the shuttle a shield of 500, but the game starts shuttles at 300 (303) and refits them to 300 at a starbase.
- The scoutship’s two-square move (line 2510) is allowed from file B or G in either direction and does not check the square passed over. A scoutship therefore appears able to jump over a piece on its first move, and one that reaches the enemy’s scoutship file can jump two squares backward.
- The re-entry check also runs after an unrecognised key or a rejected command, neither of which ends the turn. Pressing other keys therefore gives warped ships extra chances to return. The random square uses
INT (8*RND+.5), so file H and rank 8 come up about half as often as the others.
Both programs came from Oliger (JLO SAFE) disks in the SNUG library set and were converted for tape. The Oliger slashes were removed from the LOAD and SAVE commands in both programs. The game’s tape header was also renamed from HYPERCHSS to chesslodr, because the instruction program ends with LOAD "chesslodr", a loader that is not on either disk. The tape holds chessdoc, its font file, the game and its code. It was tested in ZEsarUX on a stock TS2068 through the instruction pages and the board with its command list.
Source Code
10 REM HYPERCHESS DEC 1984 by CHRIS HOWARD STONE
20 PRINT AT 16,0;"": LOAD /"hyperchssC"CODE 60000
30 POKE 23675,88: POKE 23676,255: POKE 23606,96: POKE 23607,233
40 PAPER 0: INK 6: PRINT AT 19,2;" "; FLASH 1; PAPER 2;"STOP THE TAPE RECORDER";: PRINT " "'',,
50 RESTORE 50: FOR z=1 TO 28: READ a,b: BEEP a,b: NEXT z
60 DATA .3,0,.15,-3,a,0,1,2,.15,-5,a,-3,.3,0,a,2
70 DATA .3,7,.15,9,a,2,.3,7,a,9,1.4,2
80 DATA .3,0,.15,-3,a,0,1,2,.15,-5,a,-3,.3,0,a,2
90 DATA .3,7,.15,9,a,2,.3,7,a,9,1,11
100 REM INITIALISE
110 DIM H(32): DIM W(32)
120 DIM A(8,8): DIM B(8,8)
130 RESTORE 130: FOR Z=1 TO 8: READ B(1,Z),B(8,Z): NEXT Z: DATA 12,2,13,3,14,4,16,6,15,5,14,4,13,3,12,2
140 FOR Z=1 TO 8: LET A(2,Z)=202: LET A(7,Z)=202: LET B(2,Z)=11: LET B(7,Z)=1: NEXT Z
150 RESTORE 150: FOR Z=1 TO 8: READ A(1,Z),A(8,Z): NEXT Z: DATA 404,404,303,303,404,404,707,707,707,707,404,404,303,303,404,404
160 LET NINWARP=0: POKE 23658,8
170 REM DRAW BOARD
180 PAPER 0: BORDER 0: CLS
190 PAPER 2
200 INK 7
210 PLOT 15,160: DRAW 130,0: DRAW 0,-130: DRAW -130,0: DRAW 0,130
220 FOR A=2 TO 14 STEP 4
230 FOR B=2 TO 16 STEP 4
240 PRINT AT A,B;" ";AT A+1,B;" ";AT A+2,B+2;" ";AT A+3,B+2;" "
250 NEXT B
260 NEXT A
270 PAPER 0: INK 3
280 FOR Q=1 TO 8: PRINT AT 19-2*Q,0;Q: NEXT Q
290 FOR Q=1 TO 8: PRINT AT 0,2*Q;CHR$ (Q+64): NEXT Q
300 REM DRAW YELLOW PIECES
310 PAPER 2: INK 6
320 POKE 61121,3: LET L=USR 61000
330 PRINT AT 2,2;"ab";AT 3,2;"cd";AT 14,2;"ef";AT 15,2;"gh"
340 PAPER 0: PRINT AT 4,2;"ef";AT 5,2;"gh";AT 16,2;"ab";AT 17,2;"cd"
350 POKE 61121,1: LET L=USR 61000
360 PRINT AT 8,2;"ij";AT 9,2;"kl";AT 12,2;"ef";AT 13,2;"gh"
370 PAPER 2: PRINT AT 6,2;"ef";AT 7,2;"gh";AT 10,2;"mn";AT 11,2;"op"
380 FOR A=4 TO 16 STEP 4: PRINT AT A,4;"ab";AT A+1,4;"cd": NEXT A
390 PAPER 0: FOR A=2 TO 14 STEP 4: PRINT AT A,4;"ab";AT A+1,4;"cd": NEXT A
400 REM DRAW WHITE PIECES
410 INK 7
420 POKE 61121,3: LET L=USR 61000
430 PRINT AT 2,16;"ab";AT 3,16;"cd";AT 14,16;"ef";AT 15,16;"gh"
440 PAPER 2: PRINT AT 4,16;"ef";AT 5,16;"gh";AT 16,16;"ab";AT 17,16;"cd"
450 POKE 61121,2: LET L=USR 61000
460 PRINT AT 8,16;"ij";AT 9,16;"kl";AT 12,16;"ef";AT 13,16;"gh"
470 FOR A=2 TO 14 STEP 4: PRINT AT A,14;"ab";AT A+1,14;"cd": NEXT A
480 PAPER 0: FOR A=4 TO 16 STEP 4: PRINT AT A,14;"ab";AT A+1,14;"cd": NEXT A
490 PRINT AT 6,16;"ef";AT 7,16;"gh";AT 10,16;"mn";AT 11,16;"op"
500 PAPER 0: INK 4
510 LET CLRTM=10
520 INK 4: PRINT INVERSE 1;AT 0,22;"COMMANDS"
530 RESTORE 530: FOR z=2 TO 14 STEP 2: READ z$: PRINT AT z,22;z$: NEXT z: DATA "M-MOVE","W-WARP","F-FIRE","S-STATUS","B-BASE","R-RESET","Q-QUIT"
800 REM MAIN LOOP STARTS HERE
810 LET NEMO=0: LET NREPORTS=0
820 INVERSE 1: PAPER 0: INK 6+1*(CLRTM=10): IF CLRTM=0 THEN GO TO 840
830 PRINT AT 16,22;"WHITE ": GO TO 850
840 PRINT AT 16,22;"YELLOW "
850 PRINT AT 17,22;"TO MOVE": INVERSE 0
860 REM GET KEYPRESS
870 LET P$=INKEY$: IF P$="" THEN GO TO 870
880 BEEP .05,12
890 IF P$="Q" OR P$="q" THEN GO SUB 9900
900 REM RESET ROUTINE
910 IF P$<>"R" AND P$<>"r" THEN GO TO 960
920 GO TO 100
930 GO SUB 9150: PRINT AT 20,5;"NO SHIP IN LOCATION ";L$;N$: GO SUB 9200: GO SUB 9150: GO TO 8000
950 REM WARP ROUTINE
960 IF P$<>"W" AND P$<>"w" THEN GO TO 1150
970 INK 1: GO SUB 9150: PRINT AT 19,3;"ENTER CO-ORDINATES OF SHIP";AT 21,3;"TO JUMP INTO HYPERSPACE ?"
980 GO SUB 9000: PRINT AT 21,27;L$;"?": LET X=KP: BEEP .02,24
990 GO SUB 9100: PRINT AT 21,28;N$: LET Y=KP: BEEP .02,24
1000 LET NCPR=B(X,Y)-10*(B(X,Y)>10)
1010 IF B(X,Y)<>0 THEN GO TO 1030
1020 GO TO 930
1030 IF B(X,Y)-CLRTM<-3 OR B(X,Y)-CLRTM>10 THEN GO TO 1050
1040 GO SUB 9150: PRINT AT 20,2;L$;N$;" IS NOT ONE OF YOUR SHIPS": GO SUB 9200: GO SUB 9150: GO TO 8000
1050 IF NCPR<>6 THEN GO TO 1070
1060 GO SUB 9150: PRINT AT 19,3;"BATTLESHIPS CANNOT TRAVEL";AT 21,6;"THROUGH HYPERSPACE": GO SUB 9200: GO SUB 9150: GO TO 8000
1070 GO SUB 9150: PAPER 2: INK 6: PRINT FLASH 1;AT 20,6;"HYPERDRIVE ACTIVATED"
1080 GO SUB 9250: POKE 61121,poke: LET L=USR 61000: LET L=USR 63090
1090 GO SUB 1520: INK 6*(CLRTM=0)+7*(CLRTM=10)
1100 GO SUB 1500: FOR Q=1 TO 33: NEXT Q
1110 GO SUB 1510: FOR Q=1 TO 33: NEXT Q
1120 PRINT AT 18-2*Y,2*X;" ";AT 19-2*Y,2*X;" "
1130 LET H(NINWARP+1)=B(X,Y): LET W(NINWARP+1)=A(X,Y): LET A(X,Y)=0: LET B(X,Y)=0: LET NINWARP=NINWARP+1
1140 GO SUB 9150: LET NEMO=1: GO TO 8000
1150 REM STARBASE ROUTINE
1160 IF P$<>"B" AND P$<>"b" THEN GO TO 1600
1170 IF B((1+7*(CLRTM=10)),4)=0 OR B((1+7*(CLRTM=10)),5)=0 THEN GO TO 1190
1180 GO SUB 9150: PRINT AT 19,5;"YOU HAVE NO STARBASES";AT 21,7;"AVAILABLE TO YOU": GO SUB 9200: GO SUB 9150: GO TO 8000
1190 GO SUB 9150: PRINT AT 19,3;"ENTER CO-ORDINATES OF SHIP";AT 21,4;"TO JUMP TO A STARBASE ?"
1200 GO SUB 9000: LET X=KP: PRINT AT 21,26;L$;"?": BEEP .02,24: GO SUB 9100: LET Y=KP: PRINT AT 21,27;N$: BEEP .02,24
1210 IF B(X,Y)<>0 THEN GO TO 1230
1220 GO TO 930
1230 IF B(X,Y)-CLRTM<-3 OR B(X,Y)-CLRTM>10 THEN GO TO 1250
1240 GO SUB 9150: PRINT AT 20,2;L$;N$;" IS NOT ONE OF YOUR SHIPS": GO SUB 9200: GO SUB 9150: GO TO 8000
1250 IF B(X,Y)<>6 AND B(X,Y)<>16 THEN GO TO 1270
1260 GO SUB 9150: PRINT AT 19,3;"BATTLESHIPS CANNOT JUMP TO";AT 21,11;"STARBASES": GO SUB 9200: GO SUB 9150: GO TO 8000
1270 REM JUMP O.K.
1280 LET poke=1*(B(X,Y)=11 OR B(X,Y)=14 OR B(X,Y)=15)+2*(B(X,Y)=1 OR B(X,Y)=4 OR B(X,Y)=5)+3*(B(X,Y)=2 OR B(X,Y)=3 OR B(X,Y)=12 OR B(X,Y)=13)
1290 POKE 61121,poke: LET L=USR 61000:
1300 LET NCPR=B(X,Y)-10*(B(X,Y)>10)
1310 LET BASEX=8*(CLRTM=10)+1*(CLRTM=0)
1320 LET RAND=RND
1330 LET BASEY=4*(RAND<.5)+5*(RAND>.5)
1340 IF B(BASEX,BASEY)<>0 THEN GO TO 1320
1350 PAPER INT ((ATTR (18-2*BASEY,2*BASEX)/8)): INK 6*(CLRTM=0)+7*(CLRTM=10)
1360 GO TO 1360+10*(NCPR=1 OR NCPR=2)+20*(NCPR=4 OR NCPR=3)+30*(NCPR=5)
1370 PRINT AT 18-2*BASEY,2*BASEX;"ab";AT 19-2*BASEY,2*BASEX;"cd": GO TO 1400
1380 PRINT AT 18-2*BASEY,2*BASEX;"ef";AT 19-2*BASEY,2*BASEX;"gh": GO TO 1400
1390 PRINT AT 18-2*BASEY,2*BASEX;"ij";AT 19-2*BASEY,2*BASEX;"kl"
1400 GO SUB 1520: PRINT AT 18-2*Y,2*X;" ";AT 19-2*Y,2*X;" "
1410 LET L=USR 63060
1420 LET NEMO=1
1430 LET B(BASEX,BASEY)=B(X,Y): LET B(X,Y)=0: LET A(X,Y)=0: LET A(BASEX,BASEY)=202*(NCPR=1)+303*(NCPR=3)+404*(NCPR=2 OR NCPR=4)+707*(NCPR=5 OR NCPR=6)
1440 LET X=BASEX: LET Y=BASEY: GO SUB 9300: GO SUB 9390: GO TO 8000
1500 PRINT AT 18-2*Y,2*X;"ab";AT 19-2*Y,2*X;"cd": RETURN
1510 PRINT AT 18-2*Y,2*X;"ef";AT 19-2*Y,2*X;"gh": RETURN
1520 PAPER INT ((ATTR (18-2*Y,2*X)/8)): RETURN
1600 REM STATUS REPORT ROUTINE
1610 IF P$<>"S" AND P$<>"s" THEN GO TO 1800
1620 IF NREPORTS<>3 THEN GO TO 1640
1630 GO SUB 9150: PRINT AT 19,3;"YOU HAVE ALREADY RECIEVED";AT 21,5;"THREE STATUS REPORTS": GO SUB 9200: GO SUB 9150: GO TO 8000
1640 GO SUB 9150: PRINT AT 19,3;"ENTER CO-ORDINATES OF SHIP";AT 20,5;"WHOSE STATUS IS TO BE";AT 21,10;"DISPLAYED ?"
1650 GO SUB 9000: LET X=KP: PRINT AT 21,20;L$;"?": BEEP .02,24: GO SUB 9100: LET Y=KP: PRINT AT 21,21;N$: BEEP .02,24
1660 IF B(X,Y)<>0 THEN GO TO 1680
1670 GO TO 930
1680 LET NCPR=B(X,Y)-10*(B(X,Y)>10)
1690 REM DISPLAY STATUS REPORT
1700 GO SUB 9300: GO SUB 9390
1710 LET NREPORTS=NREPORTS+1
1720 GO TO 860
1800 REM FIRE ROUTINE
1810 IF P$<>"F" AND P$<>"f" THEN GO TO 2100
1820 GO SUB 9150: PRINT AT 19,3;"ENTER CO-ORDINATES OF SHIP";AT 20,7;"WHICH IS TO FIRE A";AT 21,9;"PLASMA BOLT ?"
1830 GO SUB 9000: LET X=KP: PRINT AT 21,21;L$;"?": BEEP .02,24: GO SUB 9100: LET Y=KP: PRINT AT 21,22;N$: BEEP .02,24
1840 IF B(X,Y)<>0 THEN GO TO 1860
1850 GO TO 930
1860 IF B(X,Y)-CLRTM<-3 OR B(X,Y)-CLRTM>10 THEN GO TO 1880
1870 GO SUB 9150: PRINT AT 20,2;L$;N$;" IS NOT ONE OF YOUR SHIPS": GO SUB 9200: GO SUB 9150: GO TO 8000
1880 LET STR=INT ((A(X,Y)/10-(INT (A(X,Y)/10)))*10+.5)
1890 IF STR<>0 THEN GO TO 1920
1895 LET NCPR=B(X,Y)-10*(B(X,Y)>10)
1900 GO SUB 9300: LET S$=S$+" IN": LET SP=30-LEN S$: LET SP=(INT (SP/2))+1
1910 GO SUB 9150: PRINT AT 19,SP;S$;AT 20,7;"LOCATION ";L$;N$;" IS OUT";AT 21,9;"OF AMMUNITION": GO SUB 9200: GO SUB 9150: GO TO 8000
1920 GO SUB 9150: PRINT AT 19,5;"ENTER CO-ORDINATES OF";AT 21,9;"TARGET SHIP ?"
1930 GO SUB 9000: LET TARGX=KP: PRINT AT 21,21;L$;"?": BEEP .02,24: GO SUB 9100: LET TARGY=KP: PRINT AT 21,22;N$: BEEP .02,24
1940 IF B(TARGX,TARGY)<>0 THEN GO TO 1960
1950 GO SUB 9150: PRINT AT 20,5;"NO SHIP IN LOCATION ";: PRINT CHR$ (TARGX+64);: PRINT TARGY: GO SUB 9200: GO SUB 9150: GO TO 8000
1960 IF (X-TARGX=1 OR X-TARGX=0 OR X-TARGX=-1) AND (Y-TARGY=1 OR Y-TARGY=0 OR Y-TARGY=-1) THEN GO TO 1980
1970 GO SUB 9150: PRINT AT 20,2;"TARGET OUTSIDE FIRING RANGE": GO SUB 9200: GO SUB 9150: GO TO 8000
1980 REM FIRING IN RANGE
2000 LET A(X,Y)=A(X,Y)-1: LET A(TARGX,TARGY)=A(TARGX,TARGY)-100: LET L=USR 63000
2010 IF A(TARGX,TARGY)<100 THEN GO TO 2040
2020 GO SUB 9150: PAPER 2: INK 7: PRINT AT 19,5;"DIRECT HIT.";: PAPER 7: INK 1: PRINT " NEW STATUS";AT 21,7;"OF TARGET FOLLOWS": FOR Z=1 TO 66: NEXT Z
2030 LET NCPR=B(TARGX,TARGY)-10*(B(TARGX,TARGY)>10): LET X=TARGX: LET Y=TARGY: GO SUB 9300: GO SUB 9390: LET NEMO=1: GO TO 8000
2040 REM TARGET DESTROYED
2050 LET A(TARGX,TARGY)=0: LET B(TARGX,TARGY)=0: POKE 61121,3: LET L=USR 61000
2060 GO SUB 9150: PAPER 2: INK 6: PRINT AT 20,2; FLASH 1;"DIRECT HIT.TARGET DESTROYED": PAPER INT ((ATTR (18-2*TARGY,2*TARGX)/8)): INK 5: POKE 61121,3: LET L=USR 61000
2070 FOR Z=1 TO 8: PRINT AT 18-2*TARGY,2*TARGX;"ij";AT 19-2*TARGY,2*TARGX;"kl": BEEP .01,5: PRINT AT 18-2*TARGY,2*TARGX;"mn";AT 19-2*TARGY,2*TARGX;"op": BEEP .01,10
2080 PRINT AT 18-2*TARGY,2*TARGX;"qr";AT 19-2*TARGY,2*TARGX;"st": BEEP .01,26: NEXT Z: PRINT AT 18-2*TARGY,2*TARGX;" ";AT 19-2*TARGY,2*TARGX;" ": GO SUB 9150: LET NEMO=1: GO TO 8000
2100 REM MOVE ROUTINE
2110 IF P$<>"M" AND P$<>"m" THEN GO TO 8000
2120 GO SUB 9150: PRINT AT 19,3;"ENTER CO-ORDINATES OF SHIP";AT 21,6;"WHICH IS TO MOVE ?"
2130 GO SUB 9000: LET fromX=KP: BEEP .02,24: PRINT AT 21,23;CHR$ (fromX+64);: PRINT "?": GO SUB 9100: LET fromY=KP: BEEP .02,24: PRINT AT 21,24;fromY: LET NCPR=B(fromX,fromY)-10*(B(fromX,fromY)>10)
2140 IF B(fromX,fromY)<>0 THEN GO TO 2160
2150 GO SUB 9150: PRINT AT 20,5;"NO SHIP IN LOCATION ";: PRINT CHR$ (fromX+64);: PRINT fromY: GO SUB 9200: GO SUB 9150: GO TO 8000
2160 IF B(fromX,fromY)-CLRTM<-3 OR B(fromX,fromY)-CLRTM>10 THEN GO TO 2180
2170 GO SUB 9150: PRINT AT 20,2;CHR$ (fromX+64);: PRINT fromY;: PRINT " IS NOT ONE OF YOUR SHIPS": GO SUB 9200: GO SUB 9150: GO TO 8000
2180 GO SUB 9150: PRINT AT 19,3;"ENTER CO-ORDINATES OF NEW";AT 21,2;"LOCATION SHIP IS TO OCCUPY ?"
2190 GO SUB 9000: LET tox=KP: BEEP .02,24: PRINT AT 21,29;CHR$ (tox+64);: PRINT "?": GO SUB 9100: LET toy=KP: BEEP .02,24: PRINT AT 21,30;toy
2200 REM PARTIAL ERROR CHECK
2205 IF (fromX=tox) AND (fromY=toy) THEN GO TO 2220
2210 IF B(tox,toy)=0 THEN GO TO 2300
2215 IF (B(tox,toy)>10 AND CLRTM=10) OR (B(tox,toy)<10 AND CLRTM=0) THEN GO TO 2300
2220 GO SUB 9150: PAPER 2: INK 6: PRINT AT 20,10; FLASH 1;"ILLEGAL MOVE": GO SUB 9200: GO SUB 9150: GO TO 8000
2300 REM NOT MOVING AND TAKING OWN PIECE ELLIMINATED
2310 GO TO 2310+10*NCPR
2320 GO SUB 2500: GO TO 2400: REM SCOUTSHIP TO MOVE
2330 GO SUB 2800: GO TO 2400: REM STRATOCRUISER TO MOVE
2340 GO SUB 2600: GO TO 2400: REM SHUTTLE TO MOVE
2350 GO SUB 3000: GO TO 2400: REM STARSHIP TO MOVE
2360 GO SUB 3200: GO TO 2400: REM STARDESTROYER TO MOVE
2370 GO SUB 2700: GO TO 2400: REM BATTLESHIP TO MOVE
2400 LET poke=1*(NCPR<>2 AND NCPR<>3 AND CLRTM=0)+2*(NCPR<>2 AND NCPR<>3 AND CLRTM=10)+3*(NCPR=2 OR NCPR=3): POKE 61121,poke: LET L=USR 61000
2410 PAPER INT ((ATTR (18-2*toy,2*tox)/8)): INK 6*(CLRTM=0)+7*(CLRTM=10): GO TO 2410+10*NCPR
2430 PRINT AT 18-2*toy,2*tox;"ab";AT 19-2*toy,2*tox;"cd": GO TO 2480
2450 PRINT AT 18-2*toy,2*tox;"ef";AT 19-2*toy,2*tox;"gh": GO TO 2480
2460 PRINT AT 18-2*toy,2*tox;"ij";AT 19-2*toy,2*tox;"kl": GO TO 2480
2470 PRINT AT 18-2*toy,2*tox;"mn";AT 19-2*toy,2*tox;"op"
2480 PAPER INT ((ATTR (18-2*fromY,2*fromX)/8)): PRINT AT 18-2*fromY,2*fromX;" ";AT 19-2*fromY,2*fromX;" ": LET L=USR 63060
2490 LET B(tox,toy)=B(fromX,fromY): LET A(tox,toy)=A(fromX,fromY): LET B(fromX,fromY)=0: LET A(fromX,fromY)=0: GO SUB 9150: LET X=tox: LET Y=toy: GO SUB 8300: LET NEMO=1: GO TO 8000
2500 REM CHECK SCOUTSHIP MOVE
2505 IF toy=fromY AND B(tox,toy)<>0 THEN GO TO 2220
2510 IF (fromX=2 OR fromX=7) AND fromY=toy AND (ABS (fromX-tox)=2) THEN RETURN
2515 IF fromX-tox>1 OR fromX-tox<-1 OR fromY-toy>1 OR fromY-toy<-1 THEN GO TO 2220
2520 IF (fromX+1*(CLRTM=0)-1*(CLRTM=10))<>tox THEN GO TO 2220
2530 IF fromY<>toy AND B(tox,toy)=0 THEN GO TO 2220
2540 RETURN
2600 REM CHECK SHUTTLE MOVE
2610 IF fromX-tox>2 OR fromX-tox<-2 OR fromY-toy>2 OR fromY-toy<-2 THEN GO TO 2220
2620 IF fromX-tox=2 OR fromX-tox=-2 THEN GO TO 2650
2630 IF fromY-toy<>2 AND fromY-toy<>-2 THEN GO TO 2220
2640 RETURN
2650 IF fromY-toy<>1 AND fromY-toy<>-1 THEN GO TO 2220
2660 RETURN
2700 REM CHECK BATTLESHIP MOVE
2710 IF fromX-tox>1 OR fromX-tox<-1 OR fromY-toy>1 OR fromY-toy<-1 THEN GO TO 2220
2720 RETURN
2800 REM CHECK STRATOCRUISER MOVE
2810 IF fromX<>tox AND fromY<>toy THEN GO TO 2220
2820 IF fromX-tox=1 OR fromX-tox=-1 OR fromY-toy=1 OR fromY-toy=-1 THEN RETURN
2830 IF fromY=toy THEN GO TO 2910
2840 IF fromY>toy THEN GO TO 2880
2850 FOR Q=(fromY+1) TO (toy-1)
2860 IF B(fromX,Q)<>0 THEN GO TO 2220
2870 NEXT Q: RETURN
2880 FOR Q=(toy+1) TO (fromY-1)
2890 IF B(fromX,Q)<>0 THEN GO TO 2220
2900 NEXT Q: RETURN
2910 IF fromX>tox THEN GO TO 2950
2920 FOR Q=(fromX+1) TO (tox-1)
2930 IF B(Q,fromY)<>0 THEN GO TO 2220
2940 NEXT Q: RETURN
2950 FOR Q=(tox+1) TO (fromX-1)
2960 IF B(Q,fromY)<>0 THEN GO TO 2220
2970 NEXT Q: RETURN
3000 REM CHECK STARSHIP MOVE
3010 IF ABS (toy-fromY)<>ABS (tox-fromX) THEN GO TO 2220
3015 IF (ABS (tox-fromX)=1) AND (ABS (toy-fromY)=1) THEN RETURN
3020 IF toy>fromY THEN GO TO 3100
3030 IF tox>fromX THEN GO TO 3070
3040 FOR Q=1 TO (fromX-tox-1)
3050 IF B(tox+Q,toy+Q)<>0 THEN GO TO 2220
3060 NEXT Q: RETURN
3070 FOR Q=1 TO (tox-fromX-1)
3080 IF B(fromX+Q,fromY-Q)<>0 THEN GO TO 2220
3090 NEXT Q: RETURN
3100 IF tox>fromX THEN GO TO 3140
3110 FOR Q=1 TO (fromX-tox-1)
3120 IF B(fromX-Q,fromY+Q)<>0 THEN GO TO 2220
3130 NEXT Q: RETURN
3140 FOR Q=1 TO (tox-fromX-1)
3150 IF B(fromX+Q,fromY+Q)<>0 THEN GO TO 2220
3160 NEXT Q: RETURN
3200 REM CHECK STARDESTROYER MOVE
3210 IF fromX<>tox AND fromY<>toy THEN GO TO 3230
3220 GO SUB 2800: RETURN
3230 GO SUB 3000: RETURN
8000 REM RANDOM RE-ENTRY FROM WARP ROUTINE
8010 IF NINWARP<>0 THEN GO TO 8040
8020 IF NEMO=0 THEN GO TO 860
8030 LET CLRTM=10*(CLRTM=0)+0*(CLRTM=10): GO TO 800
8040 REM PIECE(S) IN WARP
8050 IF RND<.75 THEN GO TO 8020
8060 LET OUTWARP=INT (NINWARP*RND+.5): IF OUTWARP=0 THEN GO TO 8060
8070 LET X=INT (8*RND+.5): LET Y=INT (8*RND+.5): IF X=0 OR Y=0 THEN GO TO 8070
8075 IF B(X,Y)=6 OR B(X,Y)=16 THEN GO TO 8070
8080 LET NCPR=H(OUTWARP)-10*(H(OUTWARP)>10): LET B(X,Y)=H(OUTWARP): LET A(X,Y)=W(OUTWARP): GO SUB 9250: POKE 61121,poke: LET L=USR 61000
8085 LET H(OUTWARP)=H(NINWARP): LET H(NINWARP)=0: LET W(OUTWARP)=W(NINWARP): LET W(NINWARP)=0: LET NINWARP=NINWARP-1
8090 LET L=USR 63200
8100 INK 7*(B(X,Y)<10)+6*(B(X,Y)>10): GO SUB 1520
8110 GO SUB 1510: FOR Q=1 TO 33: NEXT Q
8120 GO SUB 1500: FOR Q=1 TO 33: NEXT Q
8130 IF NCPR=2 OR NCPR=3 THEN GO TO 8150
8140 POKE 61121,1*(B(X,Y)>10)+2*(B(X,Y)<10): GO TO 8160
8150 POKE 61121,3
8160 LET L=USR 61000
8170 GO TO 8170+10*(NCPR=1)+20*(NCPR=4)+30*(NCPR=5)+40*(NCPR=2)+50*(NCPR=3)
8180 GO TO 8210
8190 GO TO 8220
8200 PRINT AT 18-2*Y,2*X;"ij";AT 19-2*Y,2*X;"kl": GO TO 8230
8210 GO SUB 1500: GO TO 8230
8220 GO SUB 1510: GO TO 8230
8230 GO SUB 9150: GO SUB 9300: LET S$=S$+" JUMPED": LET SP=(INT ((30-LEN S$)/2))+1: PRINT AT 19,SP;S$;AT 21,7;"INTO LOCATION ";: PRINT CHR$ (X+64);: PRINT Y: GO SUB 8300: GO TO 8020
8300 REM SCOUTSHIP TO STARDESTROYER ROUTINE
8310 IF B(X,Y)<>1 AND B(X,Y)<>11 THEN RETURN
8320 IF X<>1 AND X<>8 THEN RETURN
8330 IF (X=1 AND B(X,Y)>10) OR (X=8 AND B(X,Y)<10) THEN RETURN
8340 REM SCOUTSHIP TO STARDESTROYER
8350 POKE 61121,1*(B(X,Y)>10)+2*(B(X,Y)<10): LET L=USR 61000
8360 INK 7*(B(X,Y)<10)+6*(B(X,Y)>10): GO SUB 1520: FOR Q=1 TO 10
8370 GO SUB 1500: LET L=USR 63060
8380 PRINT AT 18-2*Y,2*X;"ij";AT 19-2*Y,2*X;"kl": LET L=USR 63060
8390 NEXT Q: LET A(X,Y)=707: LET B(X,Y)=5+10*(B(X,Y)>10)
8400 LET NCPR=5: GO SUB 9300: GO SUB 9390: RETURN
9000 REM KEYPRESS A-H
9010 LET L$=INKEY$: IF L$="" THEN GO TO 9010
9020 IF CODE L$>64 AND CODE L$<73 THEN GO TO 9050
9030 IF CODE L$>96 AND CODE L$<105 THEN GO TO 9070
9040 GO TO 9000
9050 REM UPPER CASE
9060 LET KP=CODE L$-64: RETURN
9070 REM LOWER CASE
9080 LET KP=CODE L$-96: RETURN
9100 REM KEYPRESS 1-8
9110 LET N$=INKEY$: IF N$="" THEN GO TO 9110
9120 IF CODE N$<49 OR CODE N$>56 THEN GO TO 9110
9130 LET KP=CODE N$-48: RETURN
9150 REM INFORMATION WINDOW
9160 PAPER 7: FOR A=19 TO 21
9170 PRINT AT A,1,,
9180 NEXT A
9190 INK 1: RETURN
9200 REM ERROR BUZZ
9210 BEEP .5,-12: FOR Q=1 TO 133: NEXT Q: RETURN
9250 REM GIVE POKE FILE NO.
9260 GO TO 9270+10*(NCPR=2)+20*(NCPR=3)
9270 LET poke=4*(NCPR=1)+5*(NCPR=4)+6*(NCPR=5)+3*(B(X,Y)<10): RETURN
9280 LET poke=10: RETURN
9290 LET poke=11: RETURN
9300 REM PRODUCE STATUS REPORT
9310 IF B(X,Y)>10 THEN LET S$="YELLOW "
9315 IF B(X,Y)<10 THEN LET S$="WHITE "
9320 GO TO 9320+10*NCPR
9330 LET S$=S$+"SCOUTSHIP": RETURN
9340 LET S$=S$+"STRATOCRUISER": RETURN
9350 LET S$=S$+"SHUTTLE": RETURN
9360 LET S$=S$+"STARSHIP": RETURN
9370 LET S$=S$+"STARDESTROYER": RETURN
9380 LET S$=S$+"BATTLESHIP": RETURN
9390 GO SUB 9150: PRINT AT 19,1;S$: BEEP .05,48: FOR Z=1 TO 10: NEXT Z: PRINT AT 19,24;"LOC:";CHR$ (X+64);Y: BEEP .05,48: FOR Z=1 TO 6: NEXT Z
9400 PAPER 4*(INT (A(X,Y)/100)>=3)+6*(INT (A(X,Y)/100)=2)+2*(INT (A(X,Y)/100)=1): INK 1+6*(INT (A(X,Y)/100)=1)
9500 PRINT AT 21,20;"SHIELDS:";:
9510 LET STR=INT (A(X,Y)/10)*10: PRINT STR
9520 LET STR=INT ((A(X,Y)/10-(INT (A(X,Y)/10)))*10+.5)
9530 PAPER 4*(STR>=3)+6*(STR=2)+2*(STR=1 OR STR=0): INK 1+6*(STR=1 OR STR=0)
9535 BEEP .05,48: FOR Z=1 TO 10: NEXT Z
9540 PRINT AT 21,1;"PLASMA BOLTS:";STR: BEEP .05,48: FOR Z=1 TO 10: NEXT Z
9550 RETURN
9900 REM QUIT ROUTINE
9910 PAPER 7: PRINT AT 19,0,,,,,,: PAPER 2: INK 6: PRINT AT 20,0; FLASH 1;" DO YOU REALLY WANT TO QUIT NOW?"
9920 LET A$=INKEY$: IF A$="" THEN GO TO 9920
9930 IF A$="Y" OR A$="y" THEN STOP : GO TO 9960
9940 IF A$<>"N" AND A$<>"n" THEN GO TO 9920
9950 PAPER 7: PRINT AT 19,0,,,,,,: RETURN
9960 CLS : PRINT AT 10,9;"START THE TAPE": LOAD ""
9999 SAVE /"HYPERCHSS" LINE 1: SAVE /"hyperchssC"CODE 60000,5535Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.


