ADVENT - Page 1
This program was originally called ADVENT, undoubtedly in homage to the forerunner of all games of this type, the seminal ADVENT (a.k.a. Colossal Cave) written by Will Crowther for the PDP-10 in the mid-1970s. This version was later retitled "ADVENT1" after I wrote a second one.
Lines in BBC BASIC were numbered, so that they could be referenced by GOTOs. Note the forethought inherent in numbering lines at intervals of 10 so that, as here, you can insert extra code without renumbering lines. In this case, it turned out that more initialisation was necessary - I forgot that the program needed to explain what it was and what you had to do.
The BBC command line had a feature called AUTO; it could prompt you with line numbers in intervals of 10 as you entered your program. This is an excellent example of coding environment support for good programming practice.
The first puzzle is somewhat of an easy one. We can see, though, that the lack of commenting is raising some issues in understanding my motivation for writing particular code. Why W for "light the candle"? And what was the original value?
Also, the "always press Q to Quit" instruction is only valid for the first few decision points. Perhaps, in hindsight, a central key-handling routine would have served better.
BBC BASIC may well have supported subroutines, but as a larval hacker I had not yet learnt to use such complicated constructs. The program flow therefore consists entirely of GOTOs, which give one an unparalleled amount of freedom in determining and changing code paths. In my view, we've been on a slippery downward slope of encapsulation, data hiding and modularisation ever since 1968.
The user's first taste of failure. Abrupt, arbitrary and often painful death is a recurring theme of the game; one suspects this was partly due to a small child's inherent fascination with murdering things in nasty ways, and partly because killing the user off is less effort than writing new locations, or keeping track of state to permit them to revisit old areas.
Whew! Dodged that one.