Path: uunet!zephyr.ens.tek.com!tekred!saab!billr From: billr@saab.CNA.TEK.COM (Bill Randle) Newsgroups: comp.sources.games Subject: v09i096: adven - original adventure game in FORTRAN, Part08/08 Message-ID: <5635@tekred.CNA.TEK.COM> Date: 18 May 90 18:22:37 GMT Sender: news@tekred.CNA.TEK.COM Lines: 585 Approved: billr@saab.CNA.TEK.COM Submitted-by: Chris Rende Posting-number: Volume 9, Issue 96 Archive-name: adven/Part08 #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh 'a5toa1.f' <<'END_OF_FILE' XC*** A5TOA1 X X SUBROUTINE A5TOA1(A,B,C,CHARS,LENG) X XC A AND B CONTAIN A 1- TO 9-CHARACTER WORD IN A5 FORMAT, C CONTAINS ANOTHER XC WORD AND/OR PUNCTUATION. THEY ARE UNPACKED TO ONE CHARACTER PER WORD IN THE XC ARRAY "CHARS", WITH EXACTLY ONE BLANK BETWEEN B AND C (OR NONE, IF C >= 0). XC THE INDEX OF THE LAST NON-BLANK CHAR IN CHARS IS RETURNED IN LENG. X X IMPLICIT INTEGER(A-Z) X DIMENSION CHARS(20),WORDS(3),AW(12),BW(6),CW(6) X REAL*8 A(1),B(1),C(1) X DECODE(6,101,A)(AW(I),I=1,6) X DECODE(6,101,B)(AW(I),I=7,12) X IF(C(1).NE.0)DECODE(6,101,C)CW X101 FORMAT(6A1) X DO 5 I=1,12 X IF(AW(I).EQ.' ')GOTO 10 X CHARS(I)=AW(I) X5 CONTINUE X LENG=12 X GOTO 15 X10 CONTINUE X LENG=I-1 X15 IF(C(1).NE.0) GOTO 30 X LENG=LENG+1 X IF(LENG.EQ.13)CHARS(13)=' ' X RETURN X30 DO 40 I=1,6 X IF(CW(I).EQ.' ')RETURN X LENG=LENG+1 X CHARS(LENG)=CW(I) X40 CONTINUE X RETURN X END END_OF_FILE if test 966 -ne `wc -c <'a5toa1.f'`; then echo shar: \"'a5toa1.f'\" unpacked with wrong size! fi # end of 'a5toa1.f' fi if test -f 'ajar.f' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'ajar.f'\" else echo shar: Extracting \"'ajar.f'\" \(580 characters\) sed "s/^X//" >'ajar.f' <<'END_OF_FILE' XC*** AJAR .TRUE. IF OBJ IS CONTAINER AND IS OPEN XC THE NEXT LOGICAL FUNCTIONS DESCRIBE ATTRIBUTES OF OBJECTS. XC (AJAR, HINGED, OPAQUE, PRINTD, TREASR, VESSEL, WEARNG) X X LOGICAL FUNCTION AJAR(OBJ) X XC AJAR(OBJ) = TRUE IF OBJECT IS AN OPEN OR UNHINGED CONTAINER. X X IMPLICIT INTEGER(A-Z) X LOGICAL BITSET,HINGED,VESSEL X COMMON /BITCOM/ OPENBT,UNLKBT,BURNBT,WEARBT X INTEGER*4 LOCCON,OBJCON X COMMON /CONCOM/ LOCCON(250),OBJCON(150) X X AJAR=BITSET(OBJCON(OBJ),OPENBT).OR. X 1 (VESSEL(OBJ).AND..NOT.HINGED(OBJ)) X RETURN X END END_OF_FILE if test 580 -ne `wc -c <'ajar.f'`; then echo shar: \"'ajar.f'\" unpacked with wrong size! fi # end of 'ajar.f' fi if test -f 'at.f' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'at.f'\" else echo shar: Extracting \"'at.f'\" \(374 characters\) sed "s/^X//" >'at.f' <<'END_OF_FILE' XC*** AT .TRUE. IF AT OBJ X LOGICAL FUNCTION AT(OBJ) X XC AT(OBJ) = TRUE IF ON EITHER SIDE OF TWO-PLACED OBJECT X X IMPLICIT INTEGER(A-Z) X COMMON /LOCCOM/ LOC,OLDLOC,OLDLC2,NEWLOC,MAXLOC X COMMON /PLACOM/ ATLOC(250),LINK(300),PLACE(150), X 1 FIXED(150),MAXOBJ X AT=PLACE(OBJ).EQ.LOC.OR.FIXED(OBJ).EQ.LOC X RETURN X END END_OF_FILE if test 374 -ne `wc -c <'at.f'`; then echo shar: \"'at.f'\" unpacked with wrong size! fi # end of 'at.f' fi if test -f 'athand.f' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'athand.f'\" else echo shar: Extracting \"'athand.f'\" \(686 characters\) sed "s/^X//" >'athand.f' <<'END_OF_FILE' XC*** ATHAND .TRUE. IF OBJ READILY AVAILABLE X X X LOGICAL FUNCTION ATHAND(OBJ) X XC ATHAND(OBJ) = TRUE IF OBJ IS READILY REACHABLE. XC IT CAN BE LYING HERE, IN HAND OR IN OPEN CONTAINER. X X IMPLICIT INTEGER(A-Z) X COMMON /LOCCOM/ LOC,OLDLOC,OLDLC2,NEWLOC,MAXLOC X COMMON /PLACOM/ ATLOC(250),LINK(300),PLACE(150), X 1 FIXED(150),MAXOBJ X LOGICAL TOTING,AJAR,ENCLSD,HOLDNG,AAA X X CONTNR=-PLACE(OBJ) X AAA=ENCLSD(OBJ).AND.AJAR(CONTNR) X X ATHAND=PLACE(OBJ).EQ.LOC.OR.HOLDNG(OBJ).OR. X 1 (AAA.AND. X 2 (PLACE(CONTNR).EQ.LOC.OR. X 3 (TOTING(OBJ).AND.HOLDNG(CONTNR)))) X X RETURN X END END_OF_FILE if test 686 -ne `wc -c <'athand.f'`; then echo shar: \"'athand.f'\" unpacked with wrong size! fi # end of 'athand.f' fi if test -f 'bitoff.f' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'bitoff.f'\" else echo shar: Extracting \"'bitoff.f'\" \(287 characters\) sed "s/^X//" >'bitoff.f' <<'END_OF_FILE' XC*** BITOFF X X X SUBROUTINE BITOFF(OBJ,BIT) X XC TURNS OFF (SETS=0) A BIT IN OBJCON. X X IMPLICIT INTEGER(A-Z) X INTEGER*4 LOCCON,OBJCON,BITS X COMMON /CONCOM/ LOCCON(250),OBJCON(150) X X OBJCON(OBJ)=AND(OBJCON(OBJ),XOR(INTL(-1),BITS(BIT))) X RETURN X END END_OF_FILE if test 287 -ne `wc -c <'bitoff.f'`; then echo shar: \"'bitoff.f'\" unpacked with wrong size! fi # end of 'bitoff.f' fi if test -f 'biton.f' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'biton.f'\" else echo shar: Extracting \"'biton.f'\" \(269 characters\) sed "s/^X//" >'biton.f' <<'END_OF_FILE' XC*** BITON X X X SUBROUTINE BITON(OBJ,BIT) X XC TURNS ON (SETS=1) A BIT IN OBJCON. X X IMPLICIT INTEGER(A-Z) X INTEGER*4 LOCCON,OBJCON,BITS X COMMON /CONCOM/ LOCCON(250),OBJCON(150) X X OBJCON(OBJ)=OR(OBJCON(OBJ),BITS(BIT)) X RETURN X END END_OF_FILE if test 269 -ne `wc -c <'biton.f'`; then echo shar: \"'biton.f'\" unpacked with wrong size! fi # end of 'biton.f' fi if test -f 'bitset.f' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'bitset.f'\" else echo shar: Extracting \"'bitset.f'\" \(340 characters\) sed "s/^X//" >'bitset.f' <<'END_OF_FILE' XC*** BITSET XC MISCELLANEOUS LOGICAL FUNCTIONS (BITSET, PCT) XC ALSO, SUBROUTINES FOR TURNING BITS ON AND OFF (BITON, BITOFF). X X LOGICAL FUNCTION BITSET(WORD,N) X XC BITSET(COND,L,N) = TRUE IF COND(L) HAS BIT N SET X X IMPLICIT INTEGER(A-Z) X INTEGER*4 I,WORD X X BITSET=AND(WORD,0000002**N).NE.0 X5 RETURN X END END_OF_FILE if test 340 -ne `wc -c <'bitset.f'`; then echo shar: \"'bitset.f'\" unpacked with wrong size! fi # end of 'bitset.f' fi if test -f 'blind.f' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'blind.f'\" else echo shar: Extracting \"'blind.f'\" \(666 characters\) sed "s/^X//" >'blind.f' <<'END_OF_FILE' XC*** BLIND .TRUE. IF YOU CAN'T SEE AT THIS LOC XC LOCATION ATTRIBUTES. (BLIND, DARK, FORCED, INSIDE, OUTSID, PORTAL) X X X LOGICAL FUNCTION BLIND(DUMMY) X XC TRUE IF ADVENTURER IS "BLIND" AT THIS LOC, (DARKNESS OR GLARE) X X IMPLICIT INTEGER(A-Z) X INTEGER*4 LOCCON,OBJCON X COMMON /CONCOM/ LOCCON(250),OBJCON(150) X COMMON /LOCCOM/ LOC,OLDLOC,OLDLC2,NEWLOC,MAXLOC X INTEGER*4 POINTS X COMMON /OBJCOM/ PLAC(150),FIXD(150),WEIGHT(150),PROP(150), X 1 POINTS(150) X LOGICAL DARK,ATHAND X DATA LAMP /2/ X X BLIND=DARK(0).OR.(LOC.EQ.200.AND.ATHAND(LAMP).AND.PROP(LAMP) X 1 .EQ.1) X X RETURN X END END_OF_FILE if test 666 -ne `wc -c <'blind.f'`; then echo shar: \"'blind.f'\" unpacked with wrong size! fi # end of 'blind.f' fi if test -f 'burden.f' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'burden.f'\" else echo shar: Extracting \"'burden.f'\" \(1423 characters\) sed "s/^X//" >'burden.f' <<'END_OF_FILE' XC*** BURDEN .. RETURNS WEIGHT OF ITEMS BEING CARRIED X X INTEGER FUNCTION BURDEN(OBJ) X XC IF OBJ=0, BURDEN CALCULATES THE TOTAL WEIGHT OF THE ADVENTURER'S BURDEN, XC INCLUDING EVERYTHING IN ALL CONTAINERS (EXCEPT THE BOAT) THAT HE IS XC CARRYING. XC IF OBJ#0 AND OBJ IS A CONTAINER, CALCULATE THE WEIGHT OF EVERYTHING INSIDE XC THE CONTAINER (INCLUDING THE CONTAINER ITSELF). SINCE DONKEY FORTRAN XC ISN'T RECURSIVE, WE WILL ONLY CALCULATE WEIGHTS OF CONTAINED CONTAINERS XC ONE LEVEL DOWN. THE ONLY SERIOUS CONTAINED CONTAINER WOULD BE THE SACK XC THE ONLY THINGS WE'LL MISS WILL BE FILLED VS EMPTY BOTTLE OR CAGE. XC IF OBJ#0 AND ISN'T A CONTAINER, RETURN ITS WEIGHT. X X IMPLICIT INTEGER(A-Z) X INTEGER*4 POINTS X COMMON /OBJCOM/ PLAC(150),FIXD(150),WEIGHT(150),PROP(150), X 1 POINTS(150) X COMMON /HLDCOM/ HOLDER(150),HLINK(150) X COMMON /PLACOM/ ATLOC(250),LINK(300),PLACE(150), X 1 FIXED(150),MAXOBJ X LOGICAL TOTING,WEARNG X DATA BOAT /48/ X X BURDEN=0 X IF(OBJ.NE.0)GOTO 200 X DO 100 I=1,MAXOBJ X IF(.NOT.TOTING(I).OR.PLACE(I).EQ.-BOAT)GOTO 100 X BURDEN=BURDEN+WEIGHT(I) X100 CONTINUE X RETURN X X200 BURDEN=WEIGHT(OBJ) X IF(OBJ.EQ.BOAT)RETURN X TEMP=HOLDER(OBJ) X210 IF(TEMP.EQ.0)RETURN X BURDEN=BURDEN+WEIGHT(TEMP) X TEMP=HLINK(TEMP) X GOTO 210 X X END END_OF_FILE if test 1423 -ne `wc -c <'burden.f'`; then echo shar: \"'burden.f'\" unpacked with wrong size! fi # end of 'burden.f' fi if test -f 'bits.f' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'bits.f'\" else echo shar: Extracting \"'bits.f'\" \(117 characters\) sed "s/^X//" >'bits.f' <<'END_OF_FILE' XC*** BITS X INTEGER*4 FUNCTION BITS(SHIFT) X INTEGER SHIFT X BITS=000002**SHIFT X RETURN X END END_OF_FILE if test 117 -ne `wc -c <'bits.f'`; then echo shar: \"'bits.f'\" unpacked with wrong size! fi # end of 'bits.f' fi if test -f 'dead.f' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'dead.f'\" else echo shar: Extracting \"'dead.f'\" \(252 characters\) sed "s/^X//" >'dead.f' <<'END_OF_FILE' XC*** DEAD .TRUE. IF OBJ IS NOW DEAD X LOGICAL FUNCTION DEAD(OBJ) X IMPLICIT INTEGER(A-Z) X LOGICAL BITSET X INTEGER*4 LOCCON,OBJCON X COMMON/CONCOM/LOCCON(250),OBJCON(150) X DEAD=BITSET(OBJCON(OBJ),10) X RETURN X END END_OF_FILE if test 252 -ne `wc -c <'dead.f'`; then echo shar: \"'dead.f'\" unpacked with wrong size! fi # end of 'dead.f' fi if test -f 'dstroy.f' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'dstroy.f'\" else echo shar: Extracting \"'dstroy.f'\" \(205 characters\) sed "s/^X//" >'dstroy.f' <<'END_OF_FILE' XC*** DSTROY X X X SUBROUTINE DSTROY(OBJECT) X XC PERMANENTLY ELIMINATE "OBJECT" BY MOVING TO A NON-EXISTENT LOCATION. X X IMPLICIT INTEGER(A-Z) X X CALL MOVE(OBJECT,0) X RETURN X END END_OF_FILE if test 205 -ne `wc -c <'dstroy.f'`; then echo shar: \"'dstroy.f'\" unpacked with wrong size! fi # end of 'dstroy.f' fi if test -f 'edible.f' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'edible.f'\" else echo shar: Extracting \"'edible.f'\" \(259 characters\) sed "s/^X//" >'edible.f' <<'END_OF_FILE' XC*** EDIBLE .TRUE. IF OBJ CAN BE EATEN X X LOGICAL FUNCTION EDIBLE(OBJ) X IMPLICIT INTEGER(A-Z) X LOGICAL BITSET X INTEGER*4 LOCCON,OBJCON X COMMON/CONCOM/LOCCON(250),OBJCON(150) X EDIBLE=BITSET(OBJCON(OBJ),7) X RETURN X END END_OF_FILE if test 259 -ne `wc -c <'edible.f'`; then echo shar: \"'edible.f'\" unpacked with wrong size! fi # end of 'edible.f' fi if test -f 'eqv.f' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'eqv.f'\" else echo shar: Extracting \"'eqv.f'\" \(229 characters\) sed "s/^X//" >'eqv.f' <<'END_OF_FILE' X LOGICAL FUNCTION EQV(WD1,WD2) X IMPLICIT INTEGER(A-Z) X DIMENSION WD1(3),WD2(3) X EQV=.FALSE. X DO 10 I=1,3 X10 IF (WD1(I).NE.WD2(I))RETURN X EQV=.TRUE. X RETURN X END END_OF_FILE if test 229 -ne `wc -c <'eqv.f'`; then echo shar: \"'eqv.f'\" unpacked with wrong size! fi # end of 'eqv.f' fi if test -f 'gripe.f.alt' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'gripe.f.alt'\" else echo shar: Extracting \"'gripe.f.alt'\" \(103 characters\) sed "s/^X//" >'gripe.f.alt' <<'END_OF_FILE' X SUBROUTINE GRIPE(LOC,SCORE,CLOSNG,CLOSED) X IMPLICIT INTEGER(A-Z) X RETURN X END END_OF_FILE if test 103 -ne `wc -c <'gripe.f.alt'`; then echo shar: \"'gripe.f.alt'\" unpacked with wrong size! fi # end of 'gripe.f.alt' fi if test -f 'locks.f' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'locks.f'\" else echo shar: Extracting \"'locks.f'\" \(261 characters\) sed "s/^X//" >'locks.f' <<'END_OF_FILE' XC*** LOCKS .TRUE. IF YOU CAN LOCK THIS OBJ X X LOGICAL FUNCTION LOCKS(OBJ) X IMPLICIT INTEGER(A-Z) X LOGICAL BITSET X INTEGER*4 LOCCON,OBJCON X COMMON/CONCOM/LOCCON(250),OBJCON(150) X LOCKS=BITSET(OBJCON(OBJ),3) X RETURN X END END_OF_FILE if test 261 -ne `wc -c <'locks.f'`; then echo shar: \"'locks.f'\" unpacked with wrong size! fi # end of 'locks.f' fi if test -f 'log.f.alt' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'log.f.alt'\" else echo shar: Extracting \"'log.f.alt'\" \(96 characters\) sed "s/^X//" >'log.f.alt' <<'END_OF_FILE' X SUBROUTINE LOG(SCORE,TURNS,NUMDIE) X IMPLICIT INTEGER(A-Z) X RETURN X END END_OF_FILE if test 96 -ne `wc -c <'log.f.alt'`; then echo shar: \"'log.f.alt'\" unpacked with wrong size! fi # end of 'log.f.alt' fi if test -f 'motd.f.alt' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'motd.f.alt'\" else echo shar: Extracting \"'motd.f.alt'\" \(80 characters\) sed "s/^X//" >'motd.f.alt' <<'END_OF_FILE' X SUBROUTINE MOTD(ALTER) X LOGICAL ALTER X RETURN X END END_OF_FILE if test 80 -ne `wc -c <'motd.f.alt'`; then echo shar: \"'motd.f.alt'\" unpacked with wrong size! fi # end of 'motd.f.alt' fi if test -f 'pct.f' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pct.f'\" else echo shar: Extracting \"'pct.f'\" \(188 characters\) sed "s/^X//" >'pct.f' <<'END_OF_FILE' XC*** PCT X X X LOGICAL FUNCTION PCT(N) X XC PCT(N) = TRUE N% OF THE TIME (N INTEGER FROM 0 TO 100) X X IMPLICIT INTEGER(A-Z) X PCT=RAN(100).LT.N X RETURN X END END_OF_FILE if test 188 -ne `wc -c <'pct.f'`; then echo shar: \"'pct.f'\" unpacked with wrong size! fi # end of 'pct.f' fi if test -f 'val.f' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'val.f'\" else echo shar: Extracting \"'val.f'\" \(176 characters\) sed "s/^X//" >'val.f' <<'END_OF_FILE' XC*** VAL X X X INTEGER FUNCTION VAL(WORD) X XC RETURNS THE 'VALUE' OF A WORD, MODULO 1000. X X IMPLICIT INTEGER(A-Z) X VAL=MOD(WORD,1000) X RETURN X END END_OF_FILE if test 176 -ne `wc -c <'val.f'`; then echo shar: \"'val.f'\" unpacked with wrong size! fi # end of 'val.f' fi if test -f 'worn.f' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'worn.f'\" else echo shar: Extracting \"'worn.f'\" \(255 characters\) sed "s/^X//" >'worn.f' <<'END_OF_FILE' XC*** WORN .TRUE. IF OBJ IS BEING WORN X X LOGICAL FUNCTION WORN(OBJ) X IMPLICIT INTEGER(A-Z) X LOGICAL BITSET X INTEGER*4 LOCCON,OBJCON X COMMON/CONCOM/LOCCON(250),OBJCON(150) X WORN=BITSET(OBJCON(OBJ),11) X RETURN X END END_OF_FILE if test 255 -ne `wc -c <'worn.f'`; then echo shar: \"'worn.f'\" unpacked with wrong size! fi # end of 'worn.f' fi if test -f 'yes.f' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'yes.f'\" else echo shar: Extracting \"'yes.f'\" \(228 characters\) sed "s/^X//" >'yes.f' <<'END_OF_FILE' XC*** YES X X LOGICAL FUNCTION YES(X,Y,Z) X XC CALL YESX (BELOW) WITH MESSAGES FROM SECTION 6. X X IMPLICIT INTEGER(A-Z) X EXTERNAL RSPEAK X LOGICAL YESX X X YES=YESX(X,Y,Z,RSPEAK) X RETURN X END END_OF_FILE if test 228 -ne `wc -c <'yes.f'`; then echo shar: \"'yes.f'\" unpacked with wrong size! fi # end of 'yes.f' fi echo shar: End of archive 8 \(of 8\). cp /dev/null ark8isdone MISSING="" for I in 1 2 3 4 5 6 7 8 ; do if test ! -f ark${I}isdone ; then MISSING="${MISSING} ${I}" fi done if test "${MISSING}" = "" ; then echo You have unpacked all 8 archives. rm -f ark[1-9]isdone else echo You still need to unpack the following archives: echo " " ${MISSING} fi ## End of shell archive. exit 0