Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Colossal Cave Adventure in PL/I

68 views
Skip to first unread message

Robin Vowels

unread,
May 8, 2013, 6:39:13 AM5/8/13
to
On May 7, 8:32 am, "Charles Richmond" <numer...@aquaporin4.com> wrote:
> Some nice person from IBM coded the Colossal Cave Adventure in the PL/I
> programming language.  Peter Flass has a copy of the source on his web site:
>
> http://home.roadrunner.com/~pflass/PLI/code/advent.pli
>
> My question is... does anyone know what *data* file to use with this version
> of the code???   The comments at the beginning about the "database" format
> looks suspiciously like the description of the regular data file.  (Of
> course, the *code* can be changed without modifying the comments
> unfortunately...)  Compare the opening comment of the PL/I version:
>
> /* ADVENTURES
>
>     CURRENT LIMITS:
>         9650 WORDS OF MESSAGE TEXT (LINES, LINSIZ).
>          750 TRAVEL OPTIONS (TRAVEL, TRVSIZ).
>          300 VOCABULARY WORDS (KTAB, ATAB, TABSIZ).
>          150 LOCATIONS (LTEXT, STEXT, KEY, COND, ABB, ATLOC, LOCSIZ).
>          100 OBJECTS (PLAC, PLACE, FIXD, FIXED, LINK (TWICE), PTEXT,
>                      PROP).
>           35 "ACTION" VERBS (ACTSPK, VRBSIZ).
>          205 RANDOM MESSAGES (RTEXT, RTXSIZ).
>           12 DIFFERENT PLAYER CLASSIFICATIONS (CTEXT, CVAL, CLSMAX).
>           20 HINTS, LESS 3 (HINTLC, HINTED, HINTS, HNTSIZ).
>           35 MAGIC MESSAGES (MTEXT, MAGSIZ).
>
>     THERE ARE ALSO LIMITS WHICH CANNOT BE EXCEEDED DUE TO THE
>     STRUCTURE OF THE DATABASE.  (E.G., THE VOCABULARY USES
>     N/1000 TO DETERMINE WORD TYPE, SO THERE CAN'T BE MORE
>     THAN 1000 WORDS.) THESE UPPER LIMITS ARE:
>
>          1000 NON-SYNONYMOUS VOCABULARY WORDS
>          300 LOCATIONS
>          100 OBJECTS
>   */
>
> ... with the opening comment of the FORTRAN version written in F40 FORTRAN
> for the DEC-10...
>
> C  ADVENTURES
>
> C  CURRENT LIMITS:
> C      9650 WORDS OF MESSAGE TEXT (LINES, LINSIZ).
> C       750 TRAVEL OPTIONS (TRAVEL, TRVSIZ).
> C       300 VOCABULARY WORDS (KTAB, ATAB, TABSIZ).
> C       150 LOCATIONS (LTEXT, STEXT, KEY, COND, ABB, ATLOC, LOCSIZ).
> C       100 OBJECTS (PLAC, PLACE, FIXD, FIXED, LINK (TWICE), PTEXT, PROP).
> C        35 "ACTION" VERBS (ACTSPK, VRBSIZ).
> C       205 RANDOM MESSAGES (RTEXT, RTXSIZ).
> C        12 DIFFERENT PLAYER CLASSIFICATIONS (CTEXT, CVAL, CLSMAX).
> C        20 HINTS, LESS 3 (HINTLC, HINTED, HINTS, HNTSIZ).
> C        35 MAGIC MESSAGES (MTEXT, MAGSIZ).
> C  THERE ARE ALSO LIMITS WHICH CANNOT BE EXCEEDED DUE TO THE STRUCTURE OF
> C  THE DATABASE.  (E.G., THE VOCABULARY USES N/1000 TO DETERMINE WORD TYPE,
> C  SO THERE CAN'T BE MORE THAN 1000 WORDS.)  THESE UPPER LIMITS ARE:
> C       1000 NON-SYNONYMOUS VOCABULARY WORDS
> C       300 LOCATIONS
> C       100 OBJECTS
>
> So I think the data file from the original Colossal Cave Adventure *should*
> work with the PL/I version... I'd try it, *if* I had a way to compile the
> PL/I version!!! :-)  And "if I belonged to the Elks, I weld it on my watch
> chain, if I had a watch chain..."
>
> Has anyone tried to compile and run this PL/I code here???

I have successfully compiled this PL/I code.
However, I have not tried to run it yet.
Email me if you would like a copy of the source.

Greg Price

unread,
May 25, 2013, 3:31:25 AM5/25/13
to
>chomp<

Ah yes, the carefree days of circa 30 years ago...

The data file used by the PL/I version had columns 72 to 80 ORed with
x'F0' bytes for some reason, so I used the FORTRAN version's data file
and it all seemed to work okay. The records had unnecessary leading
blanks, as I recall, which is why the text extended into sequence number
columns.

Anyway, seeing that the magic (or admin) section of messages was not
used, I added modest extensions for game saving, controllable opening
hours, notification of usage to grand wizard, etc.

CURRENT LIMITS:
11200 WORDS OF MESSAGE TEXT (LINES, LINSIZ).
800 TRAVEL OPTIONS (TRAVEL, TRVSIZ).
330 VOCABULARY WORDS (KTAB, ATAB, TABSIZ, ATABB).
150 LOCATIONS (LTEXT, STEXT, KEY, COND, ABB, ATLOC, LOCSIZ).
100 OBJECTS (PLAC, PLACE, FIXD, FIXED, LINK (TWICE), PTEXT,
PROP).
50 "ACTION" VERBS (ACTSPK, VRBSIZ).
230 RANDOM MESSAGES (RTEXT, RTXSIZ).
12 DIFFERENT PLAYER CLASSIFICATIONS (CTEXT, CVAL, CLSMAX).
20 HINTS, LESS 3 (HINTLC, HINTED, HINTS, HNTSIZ).
55 MAGIC MESSAGES (MTEXT, MAGSIZ).

The whole kludgey morass is contained in CBT file 134 (and 135 for load
modules) for operation under TSO (on MVS et al systems).
CBT is at www.cbttape.org
Relevant members include:
PROGRAM - PL/I source code
DECDATE - Assembler source code
DATABASE - Data file which could be thinly disguised as an object deck
PGMINST - Installation instructions

Of the many Star Trek games, came across one in which the Enterprise had
a self-destruct command which logged you off your whole TSO session -
right back to the VTAM logo. After deciding that this was an amusing
feature, I changed the PL/I Adventure to do the same when/if the user
tried to attention interrupt out of it. The logoff remains pending if
you were not running it from the READY prompt.

Ah, good times...

Cheers,
Greg

0 new messages