Source:Remove Dummy Artifacts

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 Remove Dummy Artifacts.

Source

EAG Utilities Disk

Date

c. 1984, last modified 19 February 1996

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 
2  REM    REMOVE DUMMY ARTIFACTS


3  REM  THIS PROGRAM WILL REMOVE
4  REM  UNNEEDED ARTIFACTS FROM 
5  REM   EAMON FILES.
6  REM 
7  REM  2/19/96
8  REM 
10 D$ =  CHR$ (4): TEXT 
15  HOME : VTAB 6: PRINT "INSERT EAMON ADVENTURE DISKETTE AND ": PRINT : PRINT  SPC( 05);"PRESS ANY KEY TO CONTINUE ...";: POKE  - 16368,0: GET A$: PRINT 
20  ONERR  GOTO 15
22  PRINT D$"UNLOCK EAMON.DESC": PRINT D$"UNLOCK EAMON.ARTIFACTS"
25  PRINT D$"OPEN EAMON.DESC,L256": PRINT D$"READ EAMON.DESC,R0": INPUT NR,NA,NE,NM: PRINT D$: POKE 216,0
30  DIM A$(NA): PRINT D$;"OPEN EAMON.ARTIFACTS,L128": FOR A = 1 TO NA: PRINT D$;"READ EAMON.ARTIFACTS,R";A: INPUT A$(A): NEXT : PRINT D$;"CLOSE EAMON.ARTIFACTS"
40  HOME : PRINT "YOU WILL BE REQUESTED TO INPUT THE ": PRINT "NUMBER OF ARTIFACTS THAT YOU WANT TO ": PRINT "KEEP. THIS WILL BE THE NUMBER OF "
50  PRINT "ARTIFACTS TO REMAIN ON THE FILE. (DO ": PRINT "NOT COUNT MONSTER BODIES.)": PRINT : PRINT "BE SURE THE EAMON FILES ARE SET UP": PRINT "CORRECTLY BEFORE RUNNING THIS PROGRAM."
52  PRINT : PRINT "YOU MAY VIEW THE NAMES OF ALL ARTIFACTS BY PRESSING 'V' AT THE NEXT INPUT.": PRINT 
60  PRINT "PRESS 'S' TO STOP; 'V' TO VIEW ARTIFACTS": PRINT "OR 'C' TO CONTINUE  --> ";
65  GET A$: IF A$ <  > "V" AND A$ <  > "S" AND A$ <  > "C" THEN 65
68  PRINT A$: IF A$ = "V" THEN 1000
69  IF A$ = "S" THEN  END 
70  PRINT : INPUT "NUMBER OF ARTIFACTS TO REMAIN:";A$:RM =  VAL (A$)
80  IF RM <  >  INT (RM) OR RM > NA OR RM < 10 THEN  PRINT "THAT CANNOT BE ACCEPTED.": GOTO 70
85  HOME : PRINT "IF THERE ARE NO MONSTER BODIES ON THE   ARTIFACT FILE, PRESS 'N'; OTHERWISE     PRESS 'C' ";
88  GET BD$: IF BD$ <  > "N" AND BD$ <  > "C" THEN 88
89  PRINT BD$: IF BD$ = "N" THEN NM = 0
90  HOME : PRINT RM;" ARTIFACTS TO REMAIN ON FILE - PLUS": PRINT "BODIES FOR ";NM;" MONSTERS = ";RM + NM: PRINT "IS THIS CORRECT? (Y/N):";
95  GET A$: IF A$ <  > "Y" AND A$ <  > "N" THEN 95
98 DL = NA - RM - NM: IF DL < 1 THEN 2000
100  PRINT A$: IF A$ = "N" THEN 70
105  PRINT D$"OPEN EAMON.ARTIFACTS,L128"
110  FOR R = RM + DL + 1 TO NA
130  PRINT D$"READ EAMON.ARTIFACTS,R";R: INPUT AN$: INPUT A1,A2,A3,A4: IF A2 > 1 THEN  INPUT A5,A6,A7,A8
140  PRINT D$"WRITE EAMON.ARTIFACTS,R";R - DL: PRINT AN$: PRINT A1: PRINT A2: PRINT A3: PRINT A4: IF A2 = 2 THEN  PRINT A5: PRINT A6: PRINT A7: PRINT A8
150  PRINT D$"READ EAMON.DESC,R";R + 100: INPUT DE$: PRINT D$"WRITE EAMON.DESC,R";R - DL + 100: PRINT  CHR$ (34);DE$; CHR$ (34)
200  NEXT R
210  PRINT D$"WRITE EAMON.DESC,R0": PRINT NR: PRINT RM + NM: PRINT NE: PRINT NM: PRINT D$"CLOSE"
220  END 
1000  REM  === VIEW ===
1010  HOME :LP = 0: FOR A = 1 TO NA STEP 2: PRINT  SPC( 2 -  LEN ( STR$ (A)));A;"> "; LEFT$ (A$(A),12);: IF A < NAR THEN  PRINT  TAB( 20 -  LEN ( STR$ (A + 1)));A + 1;"> "; LEFT$ (A$(A + 1),12)
1020 LP = LP + 1: IF LP > 22 THEN  PRINT "====== PRESS ANY KEY TO CONTINUE ======";: GET A$: PRINT : HOME :LP = 0
1030  NEXT : PRINT : PRINT "====== PRESS ANY KEY TO CONTINUE ======";: GET A$: PRINT :
1040  GOTO 40
2000  REM  === DEL NONE?
2010  IF DL = 0 THEN  HOME : PRINT "PROGRAM HAS CALCULATED NO DELETIONS.": PRINT "WHY BOTHER?": END 
2020  PRINT "AN OVERLAP WOULD OCCUR. CANNOT CONTINUE.": END