From 7d42c5b2f99b016619f987d2e0bd13f3ff90e154 Mon Sep 17 00:00:00 2001 From: Adam Sampson Date: Mon, 26 Mar 2018 12:04:29 +0100 Subject: [PATCH] Reconstructed source for WUMPUS. AI:SYS1;TS WUMPUS was last modified 1977-04-12 18:16. It's closely related to SRI-NIC's version, but it's unclear which is newer, or whether they both derive from a common source. This assembles into a binary that's identical to TS WUMPUS, except for jumps from GETLF and MOVE2 to two binary patches at 50 and 55 which make input case-insensitive. (Note that EXPL ends with a bare \r, which is encoded as \356 here for itstar's benefit.) Fixes #108. --- build/build.tcl | 4 + doc/programs.md | 1 + src/games/{wumpus.100 => wumpus.101} | 437 ++++++++++++++------------- 3 files changed, 224 insertions(+), 218 deletions(-) rename src/games/{wumpus.100 => wumpus.101} (58%) diff --git a/build/build.tcl b/build/build.tcl index 668f61f6..1db0acd2 100644 --- a/build/build.tcl +++ b/build/build.tcl @@ -1104,6 +1104,10 @@ respond "\n" "TTY==120\r" respond "\n" "DIS==130\r\003" expect ":KILL" +# Hunt the Wumpus +respond "*" ":midas sys1;ts wumpus_games; wumpus\r" +expect ":KILL" + # ten50 respond "*" ":midas sys3;ts ten50_mrc; ten50\r" expect ":KILL" diff --git a/doc/programs.md b/doc/programs.md index f6045682..ada3476c 100644 --- a/doc/programs.md +++ b/doc/programs.md @@ -179,4 +179,5 @@ - WHO%, list index/uname/jname/%time in sorted list. - WHOLIN, mode line for display terminals (with date/time/job/etc info). - WHOSEN, print author of last send. +- WUMPUS, Hunt the Wumpus game. - X, Y, Z, remember DDT command and re-execute it. diff --git a/src/games/wumpus.100 b/src/games/wumpus.101 similarity index 58% rename from src/games/wumpus.100 rename to src/games/wumpus.101 index f4d3ca50..d3422aec 100644 --- a/src/games/wumpus.100 +++ b/src/games/wumpus.101 @@ -1,16 +1,19 @@ -;WUMPUS.MID;2 04-SEP-77 08:55:35 TECO'd by MRC -.SYMTAB 3500. +;Hunt the Wumpus (2018 reconstruction) -*-MIDAS-*- + TITLE WUMPUS -.DECSAV - -T=11 -T1=12 -ROOM=13 -ME=14 -CNT=15 +T=1 +T1=2 +ROOM=3 +ME=4 +CNT=5 +A=6 P=17 +TTYI=1 +TTYO=2 +.KILL TTYI, TTYO + WORLD: BLOCK 21. ;Holds the world NTABLE: BLOCK 21. ;Random table of numbers @@ -19,7 +22,18 @@ RCOUNT: BLOCK 1 ;Random # gen counter RANDP: BLOCK 1 ;Random # gen pointer ARROWS: BLOCK 1 ;Number of arrows allowed -PDL: BLOCK 200 ;Push down list +PDL: BLOCK 40 ;Push down list + +DEFINE SHOW MSG + JRST [PUSH P,A + MOVEI A,MSG + PUSHJ P,ATYPE + POP P,A + JRST .+1] +TERMIN +DEFINE SAY &MSG& + SHOW \[ASCIZ MSG] +TERMIN DEFINE SENSE PROOM,HAZARD,ORWORD LDB ROOM,PROOM @@ -45,57 +59,49 @@ PWUMP: 210100,,WORLD(ROOM) ;Byte pointer to wumpus bit PBAT: 200100,,WORLD(ROOM) ;Bat bit PPIT: 170100,,WORLD(ROOM) ;Pit bit +SPACE: ASCIZ/ / CRLF: ASCIZ/ / EXPL: ASCIZ/ - You are a famous hunter descending down into the caves of darkness, -lair of the famous man-eating wumpus. You are equiped with five -bent arrows, and all your senses. There are twenty caves connected -by tunnels, and there are two other kinds of hazards (three each): - a) Super-bats which if you stumble into their room will pick - you up and drop you in some random room in the network. - b) Pits, which are bottomless, and fatal to fall into. -Both are immovable. +YOU ARE A FAMOUS HUNTER DESCENDING DOWN INTO THE CAVES OF DARKNESS, LAIR +OF THE FAMOUS MAN-EATING WUMPUS. YOU ARE EQUIPED WITH FIVE BENT +ARROWS, AND ALL YOUR SENSES. THERE ARE TWENTY CAVES CONNECTED BY +TUNNELS, AND THERE ARE TWO OTHER KINDS OF HAZARDS (THREE EACH): + A) SUPER-BATS WHICH IF YOU STUMBLE INTO THEIR ROOM WILL PICK + YOU UP AND DROP YOU IN SOME RANDOM ROOM IN THE NETWORK. + B) PITS, WHICH ARE BOTTOMLESS, AND FATAL TO FALL INTO. +BOTH ARE IMMOVABLE. + IF YOU END UP IN THE SAME ROOM AS THE WUMPUS, YOU LOSE. NORMALLY +THE WUMPUS DOES NOT MOVE (HAVING GORGED HIMSELF UPON A PREVIOUS HUNTER). +TWO THINGS WAKE HIM UP: + 1) WALKING INTO HIS ROOM, + 2) SHOOTING AN ARROW ANYWHERE IN THE NETWORK. +IF HE WAKES THERE IS A 50-50 CHANCE HE WILL MOVE INTO AN ADJOINING CAVE. +HE IS TOO BIG TO BE PICKED UP BY BATS, AND HAS SUCKER FEET, +SO HE DOESN'T FALL INTO THE PITS. YOU CAN SMELL THE WUMPUS FROM ONE OR +TWO ROOMS AWAY. YOU CAN HEAR BATS ONE ROOM AWAY, AND FEEL DRAFTS (FROM +BOTTOMLESS PITS) FROM ONE ROOM AWAY (AND TASTE THE FEAR...). + TO SHOOT TYPE S (WITH NO CR) INSTEAD OF A MOVE, AND THEN SPECIFY +A LEGAL PATH OF LENGTH FIVE FOR THE ARROW TO FOLLOW. IF YOU GUESS AND +LOSE THE ARROW TAKES A RANDOM PATH. PATHS CAN BE TRUNCATED BY TYPING CR +INSTEAD OF A ROOM NUMBER. - If you end up in the same room as the wumpus, you lose. -Normally the wumpus does not move (having gorged himself upon a -previous hunter). Two things wake him up: - 1) Walking into his room, - 2) Shooting an arrow anywhere in the network. - - If he wakes there is a 50-50 chance he will be offended by -the intrusion and leave in disgust. If he is really riled he -will eat you. He is too big to be picked up by bats, and has -sucker feet, so he doesn't fall into the pits. - - You can smell the wumpus from one or two rooms away. You -can hear bats one room away, and feel drafts (from bottomless -pits) from one room away (and taste the fear...). - - To shoot type S (with no carriage return) instead of a -move, and then specify a legal path of five caves for the -arrow to follow. If you guess and lose the arrow takes a -random path. Paths can be truncated by typing carriage return -instead of a room number. - - Good luck hunting!! - -/ - BEG: RESET ;The beginning + GOOD LUCK HUNTING!! +î/ + BEG: ;The beginning +GO: .OPEN TTYI,[20+.UAI,,'TTY] ;[FIXME why 20?] + .VALUE 0 + .OPEN TTYO,[.UAO,,'TTY] + .VALUE 0 MOVEI P, PDL - HRROI 1,[ASCIZ/Directions? (Y or N) /] ;Does he want the expl? - PSOUT - PBIN - CAIE 1,"y - CAIN 1,"Y ;Did he say yes? - JRST [HRROI 1,EXPL - PSOUT - JRST .+1] - HRROI 1,CRLF - PSOUT + SAY /DIRECTIONS? (Y OR N) / ;Does he want the expl? +GETLF: .IOT TTYI,A + CAIN A,"Y + SHOW EXPL + SHOW CRLF PUSHJ P,NAMEF ;Fiddle with name - GTAD - HRRZM 1,X0 ;For random # gen + .RDTIME T, + MOVEM T,X0 ;For random # gen HRREI T,-5 MOVEM T,ARROWS ;Set up five bent arrows SETZM RCOUNT @@ -119,37 +125,36 @@ instead of a room number. PUSHJ P,SHUFFL PUSHJ P,IHZRDS ;Add hazards and me JRST CIRCLE - NAMEF: HRROI 1,[ASCIZ/Here's the famous Wumpus hunter Major /] - PSOUT - GJINF - MOVE 2,1 - MOVEI 1,101 - DIRST - JRST 4,.-1 - HRROI 1,[ASCIZ/ descending -into the "Caves of Darkness", lair of the deadly man-eating Wumpus. -/] - PSOUT - MOVEI 1,1000. - DISMS - HRROI 1,[ASCIZ/ Down... -/] - PSOUT - MOVEI 1,1500. - DISMS - HRROI 1,[ASCIZ/ Down... -/] - PSOUT - MOVEI 1,2000. - DISMS - HRROI 1,[ASCIZ/ Down... -/] - PSOUT - MOVEI 1,2500. - DISMS + UNAME: BLOCK 2 +NAMEF: .SUSET [.RUNAME,,UNAME] + SAY /HERE'S THE FAMOUS WUMPUS HUNTER MAJOR / + MOVE T,[440600,,UNAME] +NAMEL: ILDB T1,T + JUMPE T1,EON + ADDI T1,40 + .IOT TTYO,T1 + JRST NAMEL +EON: SHOW CRLF + SAY /DESCENDING INTO THE "CAVES OF DARKNESS", LAIR OF THE +DEADLY MAN-EATING WUMPUS./ + SHOW CRLF + MOVEI T,36 + .SLEEP T, + SAY /DOWN.../ + SHOW CRLF + MOVEI T,36 + .SLEEP T, + SAY /DOWN.../ + SHOW CRLF + MOVEI T,36 + .SLEEP T, + SAY /DOWN.../ + SHOW CRLF + MOVEI T,36 + .SLEEP T, POPJ P, - SETNTB: SETZ T, ;Set up NTABLE with 1-20 -SETNT1: ADDI T,1 + SETNTB: SETZM T ;Set up NTABLE with 1-20 +SETNT1: AOS T MOVEM T,NTABLE(T) CAIGE T,20. JRST SETNT1 @@ -161,7 +166,7 @@ SHUFF1: PUSHJ P,RANDOM ;Get random number EXCH P,NTABLE(T) ;Swap NTABLE (T) with NTABLE (ME) EXCH P,NTABLE(ME) EXCH P,NTABLE(T) - ADDI ME,1 + AOS ME CAIG ME,20. JRST SHUFF1 POPJ P, @@ -172,7 +177,7 @@ FIRSTA: MOVE ROOM,NTABLE(T1) ;Get ring entry DPB T,PROOM1 ;Put in one direction EXCH T,ROOM DPB T,PROOM2 ;Put in other - ADDI T1,1 + AOS T1 CAIG T1,20. JRST FIRSTA POPJ P, @@ -180,9 +185,9 @@ FIRSTA: MOVE ROOM,NTABLE(T1) ;Get ring entry PUSH P,T LASTA: PUSHJ P,SHUFFL ;Shuffle NTABLE MOVEI ROOM,1 - SETZ T, + SETZM T LASTA1: DPB T,PROOM3 ;Zero third tunnels - ADDI ROOM,1 + AOS ROOM CAIG ROOM,20. JRST LASTA1 MOVEI T1,1 ;Index to NTABLE @@ -204,24 +209,22 @@ LASTC: LDB T,PROOM3 DPB T,PROOM3 ;Put it in world EXCH T,ROOM DPB T,PROOM3 ;Put in other direction -LASTC1: ADDI T1,1 +LASTC1: AOS T1 CAIG T1,20. ;End of NTABLE? JRST LASTB ;Nope, go back POP P,T ;Get rid of counter POPJ P, -LASTD: ADDI ROOM,1 ;Look at next room +LASTD: AOS ROOM ;Look at next room CAIG ROOM,20. ;Looked at all? JRST LASTC ;Nope, go back AOSGE (P) ;Yep, count shuffles JRST LASTA ;Shuffle and try again - HRROI 1,[ASCIZ/Can't finish tunnels. Foo!/] - ESOUT - HALTF - JRST .-1 + SAY /(CANT FINISH TUNNELS. FOO!)/ + JRST BEG IHZRDS: PUSHJ P,SHUFFL ;Set up hazards and me PUSHJ P,SHUFFL - SETO T, ;Bit for marking world + SETOM T ;Bit for marking world MOVE ROOM,NTABLE+1 ;Wumpus goes in first room DPB T,PWUMP HRREI T1,-2 ;Three bats and pits @@ -230,41 +233,55 @@ IHZRDL: MOVE ROOM,NTABLE+4(T1) MOVE ROOM,NTABLE+7(T1) DPB T,PBAT AOJLE T1,IHZRDL - MOVE ME,NTABLE+10 ;Me - SETZ T, + PUSH P,A ;Check I'm not starting on a hazard + MOVEI T,NTABLE +PUTME: MOVE ROOM,(T) + MOVEI T1,2 + MOVEM ROOM,(P) +LOOKO: LDB ROOM,PROOM1(T1) + LDB A,PWUMP + JUMPN A,[AOJA T,PUTME] + LDB A,PPIT + JUMPN A,[AOJA T,PUTME] + MOVE ROOM,(P) + SOJGE T1,LOOKO + LDB A,PBAT + JUMPN A,[AOJA T,PUTME] + LDB A,PWUMP + JUMPN A,[AOJA T,PUTME] + LDB A,PPIT + JUMPN A,[AOJA T,PUTME] + POP P,ME + POPJ P, MWUMP: PUSH P,ROOM ;Move the Wumpus (50% chance) PUSH P,T ;Transparent to AC'S PUSH P,T1 MOVEI ROOM,1 MWUMP1: LDB T,PWUMP ;Find the Wumpus first JUMPN T,MWUMP2 ;Got him - ADDI ROOM,1 + AOS ROOM CAIG ROOM,20. JRST MWUMP1 - HRROI 1,[ASCIZ/Error @ MWUMP1/] - ESOUT - HALTF - JRST .-1 + SAY /BAD NEWS IN MWUMP./ + JRST BEG MWUMP2: PUSHJ P,RANDOM CAILE T,10. ;50% chance of moving! JRST MWUMPX ;Not this time IDIVI T,3 - SETZ T, + SETZM T DPB T,PWUMP ;Get rid of wumpus LDB ROOM,PROOM1 (T1) ;Get random room - SETO T, + SETOM T DPB T,PWUMP ;Put Wumpus there MWUMPX: POP P,T1 POP P,T POP P,ROOM POPJ P, - CIRCLE: HRROI 1,[ASCIZ/You are in room /] ;Master loop - PSOUT + CIRCLE: SAY /YOU ARE IN ROOM / ;Master loop MOVE T,ME PUSHJ P,DECPNT - HRROI 1,CRLF - PSOUT + SHOW CRLF MOVE ROOM,ME LDB T,PWUMP ;Get Wumpus bit JUMPE T,CIRCL1 ;No Wumpus, go on @@ -272,28 +289,23 @@ MWUMPX: POP P,T1 CIRCLF: MOVE ROOM,ME LDB T,PWUMP JUMPE T,CIRCL1 ;He moved, you're safe... - HRROI 1,[ASCIZ/You were eaten by the Wumpus. You lose./] - PSOUT - HALTF - JRST .-1 + SAY /YOU WERE EATEN BY THE WUMPUS./ + JRST BEG CIRCL1: LDB T,PBAT JUMPE T,CIRCL2 ;No bats, go on - HRROI 1,[ASCIZ/Bats in your room! -/] - PSOUT + SAY /BATS IN YOUR ROOM!/ + SHOW CRLF PUSHJ P,RANDOM MOVE ME,T ;Put me somewhere random. JRST CIRCLE CIRCL2: LDB T,PPIT JUMPE T,CIRCL3 ;No pits, go on - HRROI 1,[ASCIZ/You fell into a pit. You lose!/] - PSOUT - HALTF - JRST .-1 + SAY /(YOU FELL INTO A PIT. YOU LOSE!)/ + JRST BEG -CIRCL3: SETZ T1, ;Sense all around. T1 is OR-WORD +CIRCL3: SETZM T1 ;Sense all around. T1 is OR-WORD PUSHJ P,WSENSE JRST CIRCL4 WSENSE: SENSE3 PWUMP,T1 ;Sense the world!! @@ -307,64 +319,54 @@ WSENSE: SENSE3 PWUMP,T1 ;Sense the world!! LDB ROOM,PROOM3 PUSHJ P,WSENSE JUMPE T1,CIRCL5 ;No smell of Wumpus, go on - HRROI 1,[ASCIZ/I smell a Wumpus. -/] - PSOUT -CIRCL5: SETZ T1, ;Clear IOR bit + SAY /I SMELL A WUMPUS./ + SHOW CRLF +CIRCL5: SETZM T1 ;Clear IOR bit MOVE ROOM,ME SENSE3 PBAT,T1 ;Sense bats JUMPE T1,CIRCL6 ;No bats, go on - HRROI 1,[ASCIZ/I hear squeeking. -/] - PSOUT -CIRCL6: SETZ T1, ;Clear IOR bit for pits + SAY /I HEAR SQUEEKING./ + SHOW CRLF +CIRCL6: SETZM T1 ;Clear IOR bit for pits MOVE ROOM,ME SENSE3 PPIT,T1 - JUMPE T1,MOVE0 ;No bats, let him move. - HRROI 1,[ASCIZ/I feel a draft. -/] - PSOUT + JUMPE T1,MOVEX ;No bats, let him move. + SAY /I FEEL A DRAFT./ + SHOW CRLF + JRST MOVEX ;Move Routine: Does work related to user move. -MOVE0: HRROI 1,[ASCIZ/Tunnels to /] - PSOUT +MOVEX: SAY /TUNNELS TO / MOVE ROOM,ME LDB T,PROOM1 PUSHJ P,DECPNT - MOVEI 1,<" > - PBOUT + SHOW SPACE LDB T,PROOM2 PUSHJ P,DECPNT - MOVEI 1,<" > - PBOUT + SHOW SPACE LDB T,PROOM3 PUSHJ P,DECPNT - HRROI 1,CRLF - PSOUT -MOVE1: HRROI 1,[ASCIZ/Move? /] ;Demand move - PSOUT + SHOW CRLF +MOVE1: SAY /MOVE? / ;Demand move PUSHJ P,DECIN JRST MOVE2 ;Non-number, go check. - JUMPLE T,WHAT - CAILE T,20. ;Between 1-20? + SKIPE T + CAILE T,20. ;Between 1-20? JRST WHAT ;Nope. MOVE T1,ME PUSHJ P,LEGAL ;Legal move? (from T1 to T) JRST NOTPOS ;Nope, not possible MOVE ME,T ;Yep, make it JRST CIRCLE ;Go back - MOVE2: CAIE T,"s - CAIN T,"S ;Only non-number is S - JRST SHOOT ;To shoot arrow. + MOVE2: CAIN T,"S + JRST SHOOT WHAT: CAIN T,1000 JRST MOVE1 - HRROI 1,[ASCIZ/What??/] ;Non-recognizable char + SAY /WHAT??/ ;Non-recognizable char SKIPA -NOTPOS: HRROI 1,[ASCIZ/Not Possible!/] ;... - PSOUT - HRROI 1,CRLF - PSOUT +NOTPOS: SAY /NOT POSSIBLE!/ ;... + SHOW CRLF JRST CIRCLE ;Routine to determine if a tunnel exists tween T and T1 @@ -386,24 +388,21 @@ SLEGAL: AOS -1(P) ;Yep, 's legal POPJ P, ;Shoot routine to handle shooting arrows. -SHOOT: HRROI 1,[ASCIZ/hoot! -/] - PSOUT +SHOOT: SAY /HOOT!/ + SHOW CRLF AOSLE ARROWS ;Arrows left? JRST LOSE1 ;Nope - HRROI 1,[ASCIZ/Finish with CR. -/] - PSOUT + SAY /FINISH WITH CR./ + SHOW CRLF MOVE ROOM,ME ;Arrow starts at me SETZM NTABLE ;To check 180 deg bounces HRREI CNT,-5 ;Five rooms -SHOOT1: HRROI 1,[ASCIZ/Room: /] ;Get room number - PSOUT +SHOOT1: SAY /ROOM: / ;Get room number PUSHJ P,DECIN JRST SHOOTX ;Unrecognizable input = EXIT - JUMPE T,SHOOTX - CAILE T,20. - JRST SHOOTX ;Out of bounds = EXIT + SKIPE T + CAILE T,20. + JRST SHOOTX ;Out of bounds = EXIT MOVE T1,ROOM PUSHJ P,LEGAL ;Tunnel tween T and T1? JRST BOUNCE ;Nope, he's fishing, get him @@ -415,9 +414,8 @@ SHOOT1: HRROI 1,[ASCIZ/Room: /] ;Get room number SHOOTX: PUSHJ P,MWUMP ;Finished, move Wumpus JRST CIRCLF ;Go back, see if Wumpus kills, dont let ;Him move again. -BOUNCE: HRROI 1,[ASCIZ/Bounce -/] ;He tried to fool us, random arrow path. - PSOUT +BOUNCE: SAY /(BOUNCE)/ ;He tried to fool us, random arrow path. + SHOW CRLF PUSHJ P,RANDOM IDIVI T,3 LDB T,PROOM1(T1) ;Get random tunnel @@ -431,65 +429,68 @@ MEWUMP: CAMN ME,T ;Kill me or Wumpus? JUMPN T,WIN ;Yep POPJ P, -LOSE1: HRROI 1,[ASCIZ/No more arrows. You lose by default./] - PSOUT - HALTF - JRST .-1 +CONSTA -LOSE: HRROI 1,[ASCIZ/You shot yourself./] - PSOUT - HALTF - JRST .-1 +LOSE1: SAY /NO MORE ARROWS. YOU LOSE BY DEFAULT./ + JRST BEG + +LOSE: SAY /YOU SHOT YOURSELF./ + JRST BEG + +WIN: SAY /YOU SLEW THE WUMPUS. CONGRATULATIONS!!!/ + JRST BEG + +ATYPE: PUSH P,T + HRLI A,440700 + ILDB T,A + JUMPE T,[POP P,T + POPJ P,] + .IOT TTYO,T + JRST .-3 -WIN: HRROI 1,[ASCIZ/You slew the Wumpus. Congratulations!!!/] - PSOUT - HALTF - JRST .-1 ;DECIN inputs a decimal number. It must be terminated ;with a cr. First char if non-number gets returned with POPJ. ;Normal return is skip. Answer in T. -DECIN: MOVEI 1,100 - MOVEI 3,10. - NIN - JRST [ MOVEI 1,100 - BKJFN - JFCL - PBIN - CAIN 1,15 - PBIN - CAIE 1,12 - CAIN 1,37 - JRST [MOVEI T,1000 - POPJ P,] - MOVE T,1 - POPJ P,] ; No number - MOVE T,2 - MOVEI 1,100 - BKJFN - JFCL - PBIN - CAIN 1,15 - PBIN - CAIE 1,12 - CAIN 1,37 - CAIA - JRST DWHAT -CPOPJ1: AOS (P) -CPOPJ: POPJ P, +DECIN: .IOT TTYI,T + CAIE T,15 ;Is first char CR? + JRST DECDEC + HRRZI T,1000 + POPJ P, +DECDEC: CAILE T,"9 ;Is first char a digit? + POPJ P, + CAIGE T,"0 + POPJ P, + MOVE T1,T + SETZM T ;Clear result + SKIPA +DECIN1: .IOT TTYI,T1 ;Read next char + CAILE T1,"9 ;Is it a digit? + JRST DECIN2 + CAIGE T1,"0 + JRST DECIN2 + SUBI T1,"0 ;Convert to decimal and add to result + IMULI T,10. + ADD T,T1 + JRST DECIN1 +DECIN2: CAIE T1,15 ;CR? + JRST DWHAT + AOS (P) ;Success; skip return + POPJ P, -DWHAT: HRROI 1,[ASCIZ/What?? -/] - PSOUT +DWHAT: SAY /( WHAT??)/ + SHOW CRLF JRST DECIN ;Decimal print routine. Takes argument in T -DECPNT: MOVEI 1,101 - MOVE 2,T - MOVEI 3,10. - NOUT - JRST 4,.-1 +DECPNT: IDIVI T,10. + ADDI T1,"0 + PUSH P,T1 + SKIPLE T + PUSHJ P,DECPNT + POP P,T + .IOT TTYO,T POPJ P, ;Random number generator: uses formula: ; X[N+1] = ( A*X[N] + C )TAKEN MOD(M) @@ -501,13 +502,13 @@ RANDOM: SKIPE RCOUNT ;Random # GEN (RANGE = 1-20) IMUL T,MA ADD T,MC IDIV T,MM - MOVEM T,X0 + MOVEM T1,X0 MOVE T,[360600,,X0] MOVEM T,RANDP RANDX: LDB T,RANDP IDIVI T,20. MOVE T,T1 - ADDI T,1 + AOS T POPJ P, RAND1: AOS RCOUNT @@ -519,7 +520,7 @@ RAND1: AOS RCOUNT MA: 32768.-19. ;Random # gen constants MC: 262144.-11. -MM: -23. +MM: 4^11.-23. X0SAVD: 5 CONSTA