Source:Star Wars

From Eamon Wiki
Jump to navigation Jump to search
This page is a verbatim reproduction of original source material and should not be edited except for maintenance.
Description

The source code of the DOS 3.3 game Star Wars, written in Applesoft BASIC.

Source

archive.org

Date

1979

Author

Donald Brown

License

The use of this item is permitted on the grounds that it's free or in the public domain.

Main Program

100  REM ///     STAR WARS
110  REM ///
120  REM ///A ROLE-PLAYING GAME
130  REM /// (C) COPYRIGHT 1979
140  REM ///  BY DONALD BROWN
150  GOTO 170
160  FOR CN = 1 TO CF: FOR TA = AB TO AE: POKE 0,TA: POKE 1,DN: CALL 770: NEXT TA,CN: RETURN 
170  RESTORE 
180  DIM R(42,9),P(4,7),D(3),S(10,2),R$(2),B$(3),E$(4),C$(8),O$(5),P$(4),N$(5),W$(3),D$(3)
185  DIM CM$(14)
190  FOR I = 1 TO 42: FOR J = 1 TO 9:R(I,J) = 0: NEXT : NEXT 
200  FOR I = 1 TO 4: FOR J = 1 TO 7:P(I,J) = 0: NEXT : NEXT 
210  HOME : VTAB 5: PRINT  TAB( 15);"WELCOME  TO": PRINT : HTAB 16: INVERSE : PRINT "STAR WARS": NORMAL : PRINT 
220  FOR X = 1 TO 100: VTAB 13: HTAB 1: PRINT  MID$ ("                                        <==A SCIENCE FICTION ROLE-PLAYING GAME BY DONALD BROWN==>                                        ",X,40)
230  FOR A = 1 TO 10: IF  PEEK ( - 16384) = 155 THEN  POKE  - 16368,0: VTAB 13: CALL  - 868: FOR X = 1 TO 1: FOR A = 1 TO 1
240  NEXT : NEXT 
250  VTAB 13: INPUT "WHAT IS YOUR NAME?";N$(1)
260  FOR R1 = 1 TO 42: FOR X = 1 TO 5: READ R(R1,X): NEXT : NEXT 
270  DATA 30,2,0,0,4,3,4,1,0,102,0,0,0,2,221,0,5,2,0,202,10,6,4,8,103,0,7,5,0,302,0,0,6,0,311,5,0,0,9,412,8,0,0,0,111,11,0,0,5,212
280  DATA  14,12,0,10,123,0,13,11,0,222,0,0,12,0,121,15,0,0,11,512,0,0,16,14,133,0,15,17,0,232,18,16,0,0,433,19,0,0,17,242,20,0,26,18,321,21,42,37,19,462,22,41,38,20,262,0,40,39,21,562,0,34,33,24,572,23,35,32,25,272,24,36,31,26,472
290  DATA  25,19,0,27,421,26,0,28,29,552,0,27,0,0,211,27,0,0,-30,252,-29,0,0,1,452,0,25,0,0,14,0,24,0,0,24,0,23,0,0,34,0,0,23,0,44,0,0,24,0,54,0,0,25,0,64,0,20,0,0,74,0,21,0,0,84,0,22,0,0,94,0,0,22,0,104,0,0,21,0,114,0,0,20,0,124
300 P(1,1) = 1: FOR P1 = 2 TO 3:R1 =  INT ( RND (1) * 12 + 31):P(P1,1) =  - R1: NEXT : IF P(2,1) = P(3,1) THEN 300
310 R1 =  INT (29 *  RND (1) + 2):P(4,1) = R1: FOR P1 = 1 TO 4: FOR X = 2 TO 3:P(P1,X) =  INT (10 *  RND (1) + 11): NEXT : NEXT 
320 P(3,2) = P(3,2) * 2:P(1,4) = 1:P(1,6) = 1:P(4,4) = 1:P(4,6) = 1
330 R(19,7) = 3:R(26,7) = 3
340  FOR S = 1 TO  INT (20 *  RND (1) + 5)
350 R1 =  INT ( RND (1) * 30 + 1): IF R(R1,7) = 10 THEN 350
360 R(R1,7) = R(R1,7) + 1: NEXT S: FOR D = 1 TO 3:D(D) = 0: NEXT :S8 = 0
370  HOME : VTAB 3: PRINT "REBEL ";N$(1);"--": PRINT : PRINT "YOU ARE ABOARD THE MILLENIUM FALCON": PRINT "WHICH HAS JUST BEEN DRAGGED ABOARD THE  INFAMOUS ";: FLASH : PRINT "DEATH STAR": NORMAL : PRINT 
380  PRINT "THIS OF COURSE MEANS YOU ARE IN TROUBLE.BUT YOU ARE ALSO IN A POSITION TO DO    GOOD THINGS FOR THE REBELLION, SUCH AS  DAMAGING THE DEATH STAR, ELIMINATING    IMPERIAL SOLDIERS, KILLING DARTH VADER, OR RESCUING PRINCESS LEIA"
390  PRINT 
400  PRINT "YOU MIGHT EVEN BE ABLE TO SABOTAGE THE  POWER MACHINERY ROOM IN SUCH A WAY AS TOMAKE THE DEATH STAR SELF-DESTRUCT!"
410  VTAB 20: PRINT "(HIT ANY KEY FOR FURTHER ORDERS)";: GET A$
420  HOME : PRINT "YOU ARE EQUIPPED WITH A LIGHT SABRE AND A BLASTER SHIELD.  YOU MAY USE ANY": PRINT "BLASTERS YOU STRIP FROM DEAD SOLDIERS ORYOU MAY GIVE THEM TO PRISONERS YOU": PRINT "RELEASE.": PRINT 
430  PRINT "TO ESCAPE, YOU MUST RENDER THE TRACTOR  BEAM INOPERABLE BY EITHER SABOTAGING THEPOWER MACHINERY ROOM OR THE TRACTOR BEAMROOM.  YOU MUST THEN RETURN TO THE": PRINT "HANGER DECK AND TAKE OFF IN THE"
440  PRINT "MILLENIUM FALCON.": PRINT 
450  PRINT "AS WITH ANY JEDI HOPEFUL, YOU WILL ACT  THROUGH THE FORCE.  YOU WILL DO SO BY   GIVING COMMANDS FOR YOUR ACTIONS. SIMPLYHITTING 'RETURN' LISTS ALL OF THE LEGAL COMMANDS": PRINT 
460  PRINT "YOU HAVE A LIMITED AMOUNT OF TIME.": PRINT "MAY THE FORCE BE WITH YOU!": PRINT 
470  PRINT "(HIT ANY KEY TO BEGIN YOUR MISSION)";: GET A$: PRINT 
480  FOR A = 1 TO 2: READ R$(A): NEXT : FOR A = 1 TO 3: READ B$(A): NEXT : FOR A = 1 TO 4: READ E$(A): NEXT : FOR A = 1 TO 8: READ C$(A): NEXT 
490  FOR A = 1 TO 5: READ O$(A): NEXT : FOR A = 1 TO 4: READ P$(A): NEXT : FOR A = 2 TO 5: READ N$(A): NEXT : FOR A = 1 TO 3: READ W$(A): NEXT : FOR A = 1 TO 3: READ D$(A): NEXT 
500  DATA MACHINERY,CONTROL,TRACTOR BEAM,POWER,WEAPONRY,COMMAND,HANGER,EAST DETENTION,WEST DETENTION,BROWN,GREEN,BLUE,YELLOW,RED,ORANGE,BLACK,WHITE
510  DATA  WEST END,MIDDLE,EAST END,SOUTH END,NORTH END,NORTH,EAST,WEST,SOUTH,PRINCESS LEIA,THE WOOKIE,DARTH VADER,IMPERIAL SOLDIER,SHIELD,BLASTER,LIGHT SABRE
520  DATA  UNDAMAGED,DAMAGED BUT CAN BE REPAIRED,IRREPAIRABLY DAMAGED
530  FOR P = 770 TO 788: READ A: POKE P,A: NEXT 
540  DATA  173,48,192,136,208,4,198,1,240,8,202,208,246,166,0,76,2,3,96
542  FOR I = 1 TO 14: READ CM$(I): NEXT 
543  DATA GE,D,M,SABR,A,O,GI,L,F,TO,SW,TA,SAB,C
550 R1 = 1: HOME 
560  GOSUB 1750: FOR T8 =  INT (50 *  RND (1) + 76) TO 1 STEP  - 1
570  IF P(4,1) = P(1,1) THEN 610
580  IF P(4,1) = 0 THEN 610
590 X =  INT (4 *  RND (1) + 1):R1 = P(4,1): IF R(R1,X) < 1 THEN 590
600 R1 = R(R1,X):P(4,1) = R1: IF R1 = P(1,1) THEN  FLASH : PRINT "***DARTH VADER HAS ARRIVED***": NORMAL : GOSUB 2800: GOSUB 2710
610  IF C9 = 9 THEN 620
620  IF T8 =  INT (10 *  RND (1)) THEN  INVERSE : PRINT "TIME IS ALMOST OUT": NORMAL 
630  GOSUB 820: IF P(1,1) <  > P(4,1) THEN 680
640  IF P(4,6) < 1 THEN 670
650  PRINT "DARTH VADER SWINGS AT YOU WITH HIS LIGHT  SABRE!": GOSUB 2800:A1 = P(4,2):D1 = P(1,2):P1 = 1: GOSUB 840: IF P(1,1) = 0 THEN 810
660  GOTO 680
670  PRINT "DARTH VADER SWINGS AT YOU WITH HIS FIST!";:A1 = P(4,2) / 2:D1 = P(1,2):P1 = 1: GOSUB 840: IF P(1,1) = 0 THEN 810
680  IF S9 = 0 THEN 750
690  FOR S = 1 TO S9: IF  RND (1) < .1 THEN 740
700 P1 =  INT (5 *  RND (1) + 1): IF P1 <  > 5 THEN  IF P(1,1) <  >  ABS (P(P1,1)) THEN 700
710  PRINT "A SOLDIER FIRES AT ";N$(P1):A1 = S(S,2):D1 = S(S9,1):J = 5 / 4: IF P1 <  > 5 THEN D1 = P(P1,2): IF P(P1,4) = 0 THEN J = 1
720 D1 = D1 * J: GOSUB 2750
730  GOSUB 840: IF P(1,1) = 0 THEN 810
740  NEXT S
750  FOR P1 = 2 TO 3: IF P(1,1) <  > P(4,1) AND P(P1,1) =  - P(4,1) AND P(4,1) <  > 0 THEN R1 = P(4,1):R1 = 31 +  INT ( RND (1) * 12):P(P1,1) =  - R1
760  NEXT P1
770 R1 =  INT (30 *  RND (0) + 1): IF R(R1,6) = 1 THEN R(R1,6) = 0
780  NEXT T8: IF D(1) = 1 THEN 800
790  INVERSE : PRINT "THE FORCE FINALLY GAVE UP ON YOU.": NORMAL : GOTO 810
800  INVERSE : PRINT "THE DEATH STAR JUST EXPLODED.": PRINT "UNFORTUNATELY, YOU WERE STILL ABOARD": NORMAL 
810  PRINT "YOU ARE DEAD.":P(1,1) = 0: GOTO 2280
820  PRINT : INPUT "WHAT IS YOUR COMMAND?";A$: PRINT : FOR C9 = 1 TO 14: IF  LEFT$ (A$, LEN (CM$(C9))) = CM$(C9) THEN 830
825  NEXT C9: GOTO 1640
830  ON C9 GOTO 1020,1110,1680,1420,1830,2130,1490,1580,1550,1160,1230,1430,1330,2200
840 A1 = A1 - D1 + ( INT ( RND (1) * 7) - 3): IF A1 < 0 THEN  PRINT "   A MISS!":D1 = 0: RETURN 
850  IF P1 <  > 5 THEN 890
860  PRINT "   SOLDIER--HIT AND KILLED!":S8 = S8 + 1:S9 = S9 - 1:R(P(1,1),9) = R(P(1,1),9) + 1:R(P(1,1),8) = R(P(1,1),8) + 1:R(P(1,1),7) = R(P(1,1),7) - 1
870  IF R(P(1,1),7) < 0 THEN S9 = 0:R(P(1,1),7) = 0
880  GOSUB 2780: GOTO 2710
890 D1 =  INT (4 *  RND (1)):P(P1,2) = P(P1,2) - D1: PRINT "   A HIT!": IF P(P1,2) <  = 0 THEN  PRINT "   A KILLING BLOW!":P(P1,1) = 0: GOSUB 2780: GOTO 2710
900  GOSUB 2790
910  IF D1 = 0 OR P(P1,3 + D1) = 0 THEN  RETURN 
920  PRINT "   A ";W$(D1);" WAS DESTROYED":P(P1,3 + D1) = P(P1,3 + D1) - 1: GOTO 2710
930  REM  GET S$
940 R2 =  INT (R(R1,5) / 100):R3 =  INT (R(R1,5) / 10) - R2 * 10:R4 = R(R1,5) - (100 * R2 + 10 * R3): ON R4 GOTO 950,980,990,1000
950  IF R3 = 2 THEN S$ = E$(R2): GOTO 970
960 S$ = B$(R2)
970 S$ = S$ + " " + R$(R3) + " ROOM": RETURN 
980 S$ = O$(R2) + " OF THE " + C$(R3 + 1) + " CORRIDOR": RETURN 
990 S$ = "JUNCTION OF " + C$(R2 + 1) + " AND " + C$(R3 + 1) + " CORRIDORS": RETURN 
1000  IF R1 = 1 THEN S$ = "HANGER DECK": RETURN 
1010 S$ = "DETENTION CELL #" +  STR$ ( INT (R(R1,5) / 10)): RETURN 
1020  IF R(P(1,1),7) = 0 AND P(1,1) <  > P(4,1) THEN 1040
1030  PRINT "YOU CAN'T DO THAT WHILE ENEMIES ARE IN     THE ROOM!": GOTO 820
1040  GOSUB 3000: IF A > 0 THEN A$ =  MID$ (A$,A + 1): GOTO 1045
1042  PRINT "WHAT DO YOU WANT TO GET, A SHIELD, A": INPUT "  BLASTER, OR ALL (S,B,OR A)?";A$
1045 C = 1: IF  LEFT$ (A$,1) = "B" THEN C = 2
1050  IF  LEFT$ (A$,1) = "A" THEN 1090
1060  IF R(P(1,1),7 + C) = 0 THEN  PRINT "THERE AREN'T ANY ";W$(C);"S": PRINT "   TO PICK UP": GOTO 820
1070  PRINT "OK.": GOSUB 2820:R(P(1,1),7 + C) = R(P(1,1),7 + C) - 1:P(1,3 + C) = P(1,3 + C) + 1: GOSUB 2820: GOSUB 2710
1080  GOTO 820
1090  PRINT "OK.":D = P(1,1): FOR C = 1 TO 2:B = 7 + C: IF R(D,B) > 0 THEN  FOR A = 1 TO R(D,B):R(D,B) = R(D,B) - 1:P(1,3 + C) = P(1,3 + C) + 1: GOSUB 2820: NEXT A
1100  NEXT C: GOSUB 2710: GOTO 820
1110  IF R(P(1,1),7) <  > 0 OR P(1,1) = P(4,1) THEN 1030
1115  GOSUB 3000: IF A > 0 THEN A$ =  MID$ (A$,A + 1): GOTO 1125
1120  PRINT "WHAT DO YOU WANT TO DROP, A SHIELD OR": INPUT "   BLASTER (S OR B)?";A$
1125 C = 1: IF  LEFT$ (A$,1) = "B" THEN C = 2
1130  IF P(1,3 + C) = 0 THEN  PRINT "YOU AREN'T CARRYING A ";W$(C): GOTO 820
1140  PRINT "OK.":R(P(1,1),7 + C) = R(P(1,1),7 + C) + 1:P(1,3 + C) = P(1,3 + C) - 1: GOSUB 2820: GOSUB 2710
1150  GOTO 820
1160  IF R(P(1,1),7) <  > 0 OR P(1,1) = P(4,1) THEN 1030
1170  IF D(2) <  > 0 THEN  PRINT "THE ROPE'S ALREADY UP!": GOTO 820
1180  IF P(1,1) <  > 29 AND P(1,1) <  > 30 THEN  PRINT "HOW DO YOU EXPECT TO CONNECT THE ROPE      FROM THE ";S$;"?": GOTO 820
1190  SPEED= 150: PRINT "THE ROPE SWINGS--FLIES--AND ";: SPEED= 255: IF  RND (1) < .5 THEN  PRINT "MISSES.": PRINT "BETTER LUCK NEXT TIME.": RETURN 
1200  PRINT "CATCHES.": PRINT "GOOD SHOT!":D(2) = 1
1210 Y =  PEEK (37): VTAB 6
1220  GOSUB 2650: VTAB Y + 1: RETURN 
1230  IF R(P(1,1),7) <  > 0 OR P(1,1) = P(4,1) THEN 1030
1240  IF D(2) = 0 THEN  PRINT "THE ROPE ISN'T UP!": GOTO 820
1250  IF P(1,1) <  > 29 AND P(1,1) <  > 30 THEN  PRINT "HOW DO YOU EXPECT TO SWING ON THE ROPE     FROM THE ";S$;"?": GOTO 820
1260 J = 1: PRINT "THE PEOPLE SWINGING ARE--": PRINT "   YOU": FOR X = 1 TO 2: IF P(1,1) = P(X + 1,1) THEN  PRINT  TAB( 4);N$(X + 1):J = J + X
1270  NEXT X: PRINT "OKAY, NOW": SPEED= 150: PRINT ". . . UP, UP, AND AWAY--": SPEED= 255: IF J >  INT (4 *  RND (1) + 1) THEN  INVERSE : PRINT "EGAD, THE ROPE BROKE": NORMAL : GOTO 810
1280  PRINT "THE ROPE HELD, LUCKY YOU": IF P(1,1) = 30 THEN M = 29: GOTO 1300
1290 M = 30
1300  GOSUB 2720
1310  FOR X = 3 TO 1 STEP  - 1: IF P(X,1) = P(1,1) THEN P(X,1) = M
1320  NEXT X: GOTO 1750
1330  IF R(P(1,1),7) <  > 0 OR P(1,1) = P(4,1) THEN 1030
1340  IF R(P(1,1),5) - 10 *  INT (R(P(1,1),5) / 10) <  > 1 THEN  PRINT "THERE'S NOTHING TO SABOTAGE HERE": GOTO 820
1350  IF R(P(1,1),6) = 2 AND P(1,1) <  > 28 THEN  PRINT "WHY?  THE ROOM'S ALREADY IRREPAIRABLY   DESTROYED.": GOTO 820
1360  GOSUB 2760
1370 R(P(1,1),6) = R(P(1,1),6) +  INT (3 *  RND (1)): IF R(P(1,1),6) > 2 THEN R(P(1,1),6) = 2
1380 Y =  PEEK (37): VTAB 6
1390  GOSUB 2640: VTAB Y + 1
1400  IF R(P(1,1),6) = 2 AND P(1,1) = 28 AND  RND (1) < .25 THEN  GOSUB 2770: PRINT "CONGRATULATIONS.   YOU JUST STARTED THE DEATH STAR'S SELF-DESTRUCT DEVICE.":T8 =  INT (10 *  RND (1) + 3): PRINT "UH--YOU'D BETTER GET OUT OF HERE.":D(1) = 1
1410  RETURN 
1420 D(3) =  NOT D(3): GOSUB 2800: GOTO 2710
1430  IF P(1,1) <  > 1 THEN  PRINT "HOW CAN YOU TAKE OFF FROM THE": PRINT  TAB( 4);S$;"?": GOTO 820
1440  GOSUB 2740
1450  SPEED= 150: PRINT "THE MILLENIUM FALCON IS TAKING OFF.": PRINT "LEAVING HANGER NOW.": PRINT "APPROACHING TRACTOR BEAM."
1460  SPEED= 255
1470  IF R(9,6) = 0 AND R(28,6) = 0 THEN  INVERSE : PRINT "THE TRACTOR BEAM LATCHES ON.": PRINT "STRESSES TEAR THE MILLENIUM FALCON INTO ITSY-BITSY PIECES.": NORMAL : GOTO 810
1480  PRINT "TRACTOR BEAM IS INOPERABLE.": PRINT "CONGRATULATIONS ON A REMARKABLE ESCAPE.": GOTO 2280
1490  GOSUB 3000: IF A > 0 THEN A$ =  MID$ (A$,A + 1): GOTO 1499
1498  PRINT "DO YOU WANT TO GIVE TO THE PRINCESS OR": INPUT "  THE WOOKIE (P OR W)?";A$
1499 C = 1: IF  LEFT$ (A$,1) = "W" THEN C = 2
1500  IF P(1,1) <  > P(C + 1,1) THEN  PRINT : PRINT N$(C + 1);" ISN'T HERE!": GOTO 820
1505  GOSUB 3000: IF A > 1 THEN A$ =  MID$ (A$,A + 1): GOTO 1515
1510  PRINT "DO YOU WANT TO GIVE A SHIELD OR A": INPUT "   BLASTER (S OR B)?";A$
1515  IF  LEFT$ (A$,4) = "LEIA" THEN  GOSUB 3000:A$ =  MID$ (A$,A + 1): IF A = 0 THEN 1510
1517 C1 = 1: IF  LEFT$ (A$,1) = "B" THEN C1 = 2
1520  IF P(1,3 + C1) = 0 THEN  PRINT "YOU DON'T HAVE ONE TO GIVE": GOTO 820
1530  IF P(C + 1,3 + C1) > 0 THEN  PRINT "SORRY, BUT A FOLLOWER CAN ONLY CARRY ONE   OF EACH WEAPON.": GOTO 820
1540  PRINT "OK.":P(1,3 + C1) = P(1,3 + C1) - 1:P(C + 1,3 + C1) = 1: GOTO 2710
1550  PRINT "OK, SCATTER": FOR X = 3 TO 1 STEP  - 1:Y =  INT (4 *  RND (1) + 1): IF R(P(1,1),Y) > 0 AND P(X,1) = P(1,1) THEN P(X,1) = R(P(1,1),Y)
1560  NEXT : FOR X = 2 TO 3: IF P(X,1) <  > P(1,1) AND P(X,1) > 0 THEN P(X,1) =  - P(X,1)
1570  NEXT :R1 = P(1,1): GOTO 1750
1580 A$ = S$: FOR X = 1 TO 4: IF R(P(1,1),X) = 0 THEN 1620
1590  IF R(P(1,1),X) < 0 THEN  PRINT "ACROSS A WIDE CHASM":R1 =  - R(P(1,1),X): GOTO 1610
1600 R1 = R(P(1,1),X)
1610  GOSUB 930: PRINT "TO THE ";P$(X);" IS THE": PRINT S$
1620  NEXT X:S$ = A$
1630  RETURN 
1640  PRINT "I AM THE FORCE. I WILL DO THESE THINGS--": PRINT "   GET AN OBJECT": PRINT "   DROP AN OBJECT": PRINT "   MOVE NORTH, EAST, WEST, OR SOUTH": PRINT "   SABRE ON OR OFF"
1650  PRINT "   ATTACK WITH SABRE, BLASTER, OR HANDS": PRINT "   ORDER PRINCESS OR WOOKIE": PRINT "   GIVE TO PRINCESS OR WOOKIE": PRINT "   LOOK AROUND": PRINT "   FLEE (EVERYBODY RUNS AWAY)"
1660  PRINT "   TOSS ROPE TO CROSS THE CHASM": PRINT "   SWING ON THE ROPE ACROSS THE CHASM": PRINT "   TAKE-OFF IN THE MILLENIUM FALCON": PRINT "   SABOTAGE THE EQUIPMENT IN THE ROOM"
1670  PRINT "   CHARGE!  ALL GOOD GUYS ATTACK"
1675  SPEED= 255: GOTO 820
1680  IF R(P(1,1),7) <  > 0 OR P(1,1) = P(4,1) THEN 1030
1685  GOSUB 3000: IF A > 0 THEN A$ =  MID$ (A$,A + 1): GOTO 1695
1690  PRINT "DO YOU WANT TO MOVE NORTH, EAST, WEST,": INPUT "  OR SOUTH (N,E,W,S)?";A$
1695  FOR C = 1 TO 4: IF  LEFT$ (A$,1) =  MID$ ("NEWS",C,1) THEN 1710
1700  NEXT C: GOTO 1690
1710 R1 = R(P(1,1),C): IF R1 <  = 0 THEN  PRINT "YOU CAN'T GO THAT WAY.": GOTO 820
1720  PRINT "OK"
1730  FOR C = 3 TO 1 STEP  - 1: IF P(C,1) = P(1,1) THEN P(C,1) = R1
1740  NEXT C
1750  IF P(1,1) =  - P(2,1) THEN  PRINT "YOU FOUND THE PRINCESS.": PRINT "SHE THANKS YOU AND FOLLOWS YOU.":P(2,1) = P(1,1): GOSUB 2720
1760  IF P(1,1) <  >  - P(3,1) THEN 1800
1770  IF P(3,7) THEN P(3,1) = P(1,1): GOTO 1800
1780  PRINT "YOU ARE GREETED BY A LARGE, EXTREMELY   DANGEROUS-LOOKING WOOKIE.": IF  RND (1) < .25 THEN  INVERSE : PRINT "HE CHARGES AND RIPS YOUR ARMS OUT.": NORMAL : GOTO 810
1790  PRINT "FORTUNATLEY, HE DECIDES TO JOIN UP WITH YOU.":P(3,1) = P(1,1):P(3,7) = 1: GOSUB 2720
1800 R1 = P(1,1): GOSUB 930:S9 = R(P(1,1),7)
1810  FOR S = 1 TO S9:S(S,1) =  INT (16 *  RND (1)):S(S,2) =  INT (16 *  RND (1)): NEXT S
1820  FOR X = 1 TO 100: NEXT : GOTO 2510
1830 F1 = 0
1840 P = 1
1845  GOSUB 3000: IF A = 0 THEN 1850
1846 A$ =  MID$ (A$,A + 1): IF  LEFT$ (A$,1) = "W" THEN 1845
1847  GOTO 1855
1850  PRINT "WANT TO ATTACK WITH BLASTER, SABRE, OR": INPUT "  HAND-TO-HAND (B,S, OR H)?";A$
1855  FOR C = 1 TO 3: IF  LEFT$ (A$,1) =  MID$ ("BSH",C,1) THEN  ON C GOTO 1860,1860,1890
1857  NEXT C: GOTO 1850
1860  IF P(1,4 + C) > 0 THEN 1890
1870  PRINT "YOU DON'T HAVE A ";W$(C + 1): IF F1 THEN 1850
1880  GOTO 820
1890  IF P(1,1) <  > P(4,1) THEN 1910
1900  PRINT "ATTACKING DARTH VADER":P1 = 4:D1 = P(4,2): GOTO 1950
1910  IF S9 > 0 THEN 1940
1920  PRINT "NOBODY TO ATTACK": IF F1 THEN  RETURN 
1930  GOTO 820
1940  PRINT "ATTACKING AN IMPERIAL SOLDIER":P1 = 5:D1 = S(S9,1)
1950  ON C GOTO 1960,2040,2120
1960  IF P(P,5) > 0 THEN 1990
1970  PRINT "YOU DON'T HAVE A BLASTER!": IF F1 THEN 1850
1980  GOTO 820
1990  GOSUB 2750
2000  IF P(1,1) <  > P(4,1) THEN 2020
2010  IF P(4,4) = 0 THEN 2030
2020 D1 = D1 * 5 / 4
2030 A1 = P(P,3): GOTO 840
2040  IF P(1,6) > 0 THEN 2070
2050  PRINT "YOU DON'T HAVE A LIGHT-SABRE!": IF F1 THEN 1850
2060  GOTO 820
2070  IF D(3) <  > 0 THEN 2100
2080  PRINT "YOU KNOW, IT HELPS IF YOU TURN ON YOUR     LIGHT-SABRE": IF F1 THEN 1850
2090  GOTO 820
2100  GOSUB 2800
2110 A1 = P(P,2): GOTO 840
2120 A1 = P(P,2) / 2: GOTO 840
2130  GOSUB 3000: IF A > 0 THEN A$ =  MID$ (A$,A + 1): GOTO 2137
2135  PRINT "WHO ARE YOU ORDERING, PRINCESS LEIA": INPUT "   OR THE WOOKIE (P OR W)?";A$
2137 C = 1: IF  LEFT$ (A$,1) = "W" THEN C = 2
2140  IF P(1,1) <  > P(C + 1,1) THEN  PRINT "YOU CAN'T GIVE ORDERS TO": PRINT N$(C + 1);" RIGHT NOW.": GOTO 820
2143  GOSUB 3000: IF A > 0 THEN A$ =  MID$ (A$,A + 1): GOTO 2155
2150  PRINT "IS THE ORDER TO SHOOT, ATTACK, OR WAIT": INPUT "   (S,A, OR W)?";A$
2155  IF  LEFT$ (A$,4) = "LEIA" THEN  GOSUB 3000:A$ =  MID$ (A$,A + 1): IF A = 0 THEN 2150
2157  IF  LEFT$ (A$,2) = "TO" THEN  GOSUB 3000:A$ =  MID$ (A$,A + 1): IF A = 0 THEN 2150
2158  FOR C1 = 1 TO 3: IF  LEFT$ (A$,1) =  MID$ ("SAW",C1,1) THEN  ON C1 GOTO 2160,2180,2190
2159  NEXT C1: GOTO 2150
2160  IF P(C + 1,5) <  > 1 THEN  PRINT N$(C + 1);" HAS NO BLASTER": GOTO 820
2170 P = C + 1:C = 1: GOTO 1890
2180 P = C + 1:C = 3: GOTO 1890
2190  PRINT "OK.":P(C + 1,1) =  - P(C + 1,1): RETURN 
2200 F1 = 1: GOSUB 1840: FOR P = 2 TO 3: IF P(1,1) <  >  ABS (P(P,1)) THEN 2270
2210  IF S9 <  > 0 THEN 2230
2220  IF P(1,1) <  > P(4,1) THEN  PRINT "NO ENEMIES": GOTO 2270
2230  PRINT "DO YOU WANT ";N$(P): PRINT "   TO SHOOT, ATTACK OR DO NOTHING": INPUT "   (S,A, OR N)?";A$: FOR C = 1 TO 3: IF  LEFT$ (A$,1) =  MID$ ("SAN",C,1) THEN  ON C GOTO 2240,2260,2270
2235  NEXT : GOTO 2230
2240  IF P(P,5) = 0 THEN  PRINT N$(P);" HAS NO BLASTER": GOTO 2230
2250 C = 1: GOSUB 1890: GOTO 2270
2260 C = 3: GOSUB 1890
2270  NEXT P: RETURN 
2280  PRINT "LET'S SEE HOW YOU DID.": PRINT "YOU KILLED ";S8;" IMPERIAL SOLDIERS."
2290  IF P(1,1) <  > 1 THEN  PRINT "YOU DIDN'T MAKE IT OUT ALIVE.":S8 = S8 - 10: GOTO 2320
2300  PRINT "YOU ESCAPED ";:S8 = S8 + 10: IF P(2,1) = 1 THEN  PRINT "WITH THE PRINCESS!";:S8 = S8 + 25
2310  IF P(3,1) < 0 AND P(3,7) THEN  PRINT : PRINT "YOU ABANDONED THE WOOKIE, YOU CAD!";:S8 = S8 - 25
2320  PRINT 
2330  IF P(4,1) = 0 THEN  PRINT "YOU KILLED DARTH VADER.":S8 = S8 + 25
2340  IF D(1) = 1 THEN  PRINT "YOU DESTROYED THE DEATH STAR!":S8 = S8 + 100: GOTO 2400
2350 P(1,1) = 0:P(2,1) = 0:P(3,1) = 0: FOR X = 1 TO 30:S9 = R(X,6) + 1:P(S9,1) = P(S9,1) + 1: NEXT X
2360  PRINT P(2,1) + P(3,1);" ROOMS WERE DAMAGED, HOWEVER,": PRINT P(2,1);" OF THEM COULD BE REPAIRED.":S8 = S8 + 3 * P(2,1) + 5 * P(3,1)
2370  FOR R = 1 TO 3: READ R1,A$: DATA 7,WEAPONRY MACHINERY ROOM,13,COMMAND CONTROL ROOM,28,POWER MACHINERY ROOM
2380  IF R(R1,6) > 0 THEN  PRINT "THE ";A$;" WAS DAMAGED":S8 = S8 + 10
2390  NEXT R
2400  PRINT : PRINT "YOUR FINAL SCORE WAS ";S8: ON  INT ( ABS (S8) / 25) + 1 GOTO 2420,2430,2440,2450,2460,2470,2480
2410  GOTO 2480
2420 A$ = "TERRIBLE": GOTO 2490
2430 A$ = "BAD": GOTO 2490
2440 A$ = "FAIR": GOTO 2490
2450 A$ = "GOOD": GOTO 2490
2460 A$ = "VERY GOOD": GOTO 2490
2470 A$ = "INCREDIBLY GOOD": GOTO 2490
2480 A$ = "ABSOLUTELY UNBELIEVABLE"
2490  PRINT "ALL IN ALL,": PRINT "YOU WERE ";A$
2500  TEXT : VTAB 23: END 
2510  TEXT : HOME 
2520  VTAB 1:X =  INT ((40 -  LEN (S$)) / 2): IF X < 1 THEN X = 1
2530  HTAB X: INVERSE : PRINT S$: NORMAL 
2540  PRINT "DOORS OPEN TO";: FOR X = 1 TO 4: IF R(P(1,1),X) > 0 THEN  PRINT "  ";P$(X);
2550  NEXT : PRINT :T$ = "OFF": IF D(3) THEN T$ = "ON"
2560  PRINT "CARRYING--";: IF P(1,6) > 0 THEN  PRINT "SABRE ";: INVERSE : PRINT T$;: NORMAL : PRINT " ";
2570  PRINT P(1,4);" SLD.  ";P(1,5);" BLST.";: CALL  - 868: PRINT 
2580  FOR P = 2 TO 4: IF P(1,1) =  ABS (P(P,1)) THEN  PRINT "P:";: FOR P = 2 TO 4: IF P(1,1) =  ABS (P(P,1)) THEN  PRINT " ";: INVERSE : PRINT N$(P);: NORMAL 
2590  NEXT : CALL  - 868: PRINT 
2600  PRINT "IN ROOM--";: IF S9 THEN  PRINT S9;" SOLDIERS  ";
2610  IF R(P(1,1),8) OR R(P(1,1),9) THEN  PRINT R(P(1,1),8);" SLD.  ";R(P(1,1),9);" BLST.";
2620  IF  NOT S9 AND  NOT R(P(1,1),8) AND  NOT R(P(1,1),9) THEN  PRINT "NOTHING";
2630  CALL  - 868: PRINT 
2640  IF R(P(1,1),5) - 10 *  INT (R(P(1,1),5) / 10) = 1 THEN  PRINT "EQUIPMENT--";D$(R(P(1,1),6) + 1);: CALL  - 868: PRINT 
2650  IF P(1,1) = 29 THEN  PRINT "CHASM TO SOUTH--";
2660  IF P(1,1) = 30 THEN  PRINT "CHASM TO NORTH--";
2670  IF P(1,1) = 29 OR P(1,1) = 30 THEN  IF D(2) THEN  PRINT "ROPE IS UP";: CALL  - 868: PRINT 
2680  IF P(1,1) = 29 OR P(1,1) = 30 THEN  IF  NOT D(2) THEN  PRINT "ROPE IS NOT UP"
2690  PRINT "----------------------------------------";: POKE 34, PEEK (37)
2700  RETURN 
2710 Y =  PEEK (37):P9 = P: GOSUB 2520: VTAB Y + 1:P = P9: RETURN 
2720  FOR CN = 1 TO 250: IF  PEEK ( - 16384) > 127 THEN  POKE  - 16368,0: RETURN 
2730  NEXT : RETURN 
2740 CF = 4:AB = 1:AE = 10:DN = 5: GOTO 160
2750 CF = 1:AB = 5:AE = 20:DN = 3: GOTO 160
2760 CF = 1:AB = 25:AE = 30:DN = 5: GOTO 160
2770 CF = 6:AB = 20:AE = 20:DN = 50: GOTO 160
2780 CF = 1:AB = 75:AE = 75:DN = 30: GOSUB 160
2790 CF = 4:AB = 11:AE = 15:DN = 2: GOTO 160
2800 CF = 1:AB = 100:AE = 115:DN = 3: GOTO 160
2810 CF = 5:AB = 5:AE = 5:DN = 3: GOTO 160
2820 CF =  PEEK ( - 16336) -  PEEK ( - 16336) +  PEEK ( - 16336) -  PEEK ( - 16336): RETURN 
3000  FOR A = 1 TO  LEN (A$): IF  MID$ (A$,A,1) = " " THEN  RETURN 
3010  NEXT A:A = 0: RETURN