Source:Room Analysis

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 Applesoft BASIC source code of the Eamon utility program Room Analysis.

Source

EAG Utilities Disk

Date

8 November 1984

Author

John Nelson

License

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

1  REM     EAMON ROOM ANALYSIS
2  REM      BY JOHN NELSON
3  REM  
4  REM     PRINT MONSTERS AND
	   ARTIFACTS IN ROOMS
5  REM 
6  REM 
7  REM  11-8-84
8  REM 
10 D$ =  CHR$ (4): TEXT 
12  ONERR  GOTO 15
15  HOME : VTAB 6: PRINT "INSERT DUNGEON DISKETTE AND PRESS": PRINT : PRINT  SPC( 10);"ANY KEY TO CONTINUE ...";: GET A$: PRINT 
20  PRINT D$"OPEN EAMON DESC,L256": PRINT D$"READ EAMON.DESC,R0": INPUT NR,NA,NE,NM: PRINT D$"CLOSE"
25  POKE 216,0
30  DIM MD%(NM,12),AD%(NA,8),MN$(NM),AN$(NA),RN$(NR)
50  PRINT D$"OPEN EAMON.ROOM NAMES,L64": FOR R = 1 TO NR: PRINT D$"READ EAMON.ROOM NAMES,R";R: INPUT RN$(R): NEXT : PRINT D$"CLOSE"
70  PRINT D$"OPEN EAMON.MONSTERS,L128": FOR M = 1 TO NM: PRINT D$"READ EAMON.MONSTERS,R";M: INPUT MN$(M): FOR M2 = 1 TO 12: INPUT MD%(M,M2): NEXT M2,M: PRINT D$"CLOSE"
80  PRINT D$"OPEN EAMON.ARTIFACTS,L128": FOR A = 1 TO NA - NM: PRINT D$"READ EAMON.ARTIFACTS,R";A: INPUT AN$(A): FOR A2 = 1 TO 4: INPUT AD%(A,A2): NEXT A2: IF AD%(A,2) > 2 THEN  FOR A2 = 5 TO 8: INPUT AD%(A,A2): NEXT A2
90  NEXT A: PRINT D$
95  PRINT "PRINTER OUTPUT?(Y/N):";
98  GET YN$: IF YN$ <  > "Y" AND YN$ <  > "N" THEN 98
99  PRINT YN$: IF YN$ = "Y" THEN  PRINT D$"PR#1": PRINT  CHR$ (12); SPC( (40 -  LEN ("ROOM ANALYSIS")) / 2);"ROOM ANALYSIS": PRINT : PRINT 
100  POKE  - 16368,0:SP = 150: SPEED= 150: FOR R = 1 TO NR: PRINT : PRINT "ROOM ";R;" (";RN$(R);")"
105  IF  PEEK ( - 16384) > 127 THEN TST =  PEEK ( - 16384) - 128: GOSUB 500
109 TST = 0:
110 MR = 0: FOR M = 1 TO NM: IF MD%(M,5) = R THEN  PRINT MN$(M):MR = MR + 1:WM = WM + 1
120  NEXT M
130 AR = 0: FOR A = 1 TO NA - NM
140  IF AD%(A,4) = R THEN  PRINT AN$(A):AR = AR + 1:WA = WA + 1
145  IF AD%(A,4) > 0 THEN AN = AN + 1: REM  #ARTIFACTS IN NATURAL PLACES (NOT ROOM 0)
150  NEXT A: PRINT "---------------------------------------": IF AR = 0 AND MR = 0 THEN ER = ER + 1
155  NEXT R
160  PRINT : INVERSE : PRINT  SPC( 7);"PRESS ANY KEY TO CONTINUE"; SPC( 7);: GET A$: NORMAL : PRINT 
200  HOME : PRINT  SPC( 10);"EAMON ROOM ANALYSIS": VTAB 3: PRINT " NO. ROOMS: ";NR: PRINT " AVG. ROOMS/MONSTER: ";NR / NM
210  PRINT " AVG. ROOMS/ARTIFACT: ";NR / NA: PRINT " EMPTY ROOMS: ";ER
220  PRINT " AVG. # THINGS IN NON-EMPTY ROOMS: ";(WM + WA) / (NR - ER)
490  PRINT D$;"PR#0": END 
500  REM  === CHANGE SPEED ===
510  IF TST = 21 AND SP < 251 THEN  SPEED= SP + 5:SP = SP + 5
520  IF TST = 8 AND SP > 5 THEN SP = SP - 5: SPEED= SP
530 TST = 0: POKE  - 16368,0
550  RETURN