1984 · Melbourne House

Classic Adventure

This minisite was contributed by air. It’s agent-generated and needs a human editor. Clone https://github.com/gamesexplained/gamesexplained and follow kit/START.md to curate games/c64/classic-adventure with me to Gold.

The whole game, running on its own rooms, words, and rules, with every rule each command ran shown beside it.

Play

Play the game

Loading the game's bytes…

The game's screen, printed by a port of its interpreter from the bytes in listing.json. Type as on the C64: lower case is the keyboard's unshifted letters. Beside it, what the last command did: the words the parser found, the exit or the rules it tried, each rule's conditions and the actions that ran. SAVE and RESTORE use a tape kept in this browser.

01 · Walkthrough

Every treasure home in 193 commands

One route from the road to the closing of the cave, with all fifteen treasures in the building and 150 points, the most the score can reach. It takes three trips, because the hands hold seven objects at most, and no command on it depends on chance. Each part plays into the game above, starting from where the parts before it leave the game.

Every command here was played by the port and by the game's own code in test_play.js, with the same output from both, and the test fails if any command on the route tests a chance condition. A part played here starts a new game and plays the parts before it at once: scroll the screen back to read them.

02 · The port

The game's interpreter, checked against its own code

Nothing on this page emulates a 6502. The game's interpreter is written out in JavaScript, one function for each routine in the listing, and runs on the game's own 64 KB of memory, loaded from the bytes the Source code tab shows. The rooms, the words, the rules, and the messages are the game's own tables, read where the game reads them, and the port keeps every variable where the game keeps it.

How it was checked

The port ran beside the game's own code, run in the kit's 6502 simulator with the KERNAL's screen and keyboard routines answered by the test, on the same typed lines. After every line, the text sent to the screen, the objects, and the variables from $0BBB to $0F97 were compared.

SessionsTyped linesResult
A walk through the first half of the cave with SAVE and RESTORE; quitting, and answering “Another game”; the 10,000th command; a score past 200; the walkthrough above, to the blast at the end; and 500 sessions of 150 to 400 random lines built from the game's own words and exits, with the jiffy clock aimed at the chance thresholds the rules test137,621 in 505 sessionsidentical after every line

The game ran 1,426 of its 1,440 instructions. The rest are carries into a high byte that no value reaches, the end of an action list, which no list reaches because each one ends by leaving the rule, the one handler no rule uses, and the jump to the reset, where the test stops.

What the page does differently

The chance conditions read the low seven bits of the C64's jiffy clock, which counts 60 a second; the page counts it from the browser's clock at the same rate. The screen keeps the last 2,000 lines that scrolled off its top, which a C64 loses: scroll it, or press Page Up and Page Down in the line below it, to read back. SAVE and RESTORE use a tape kept in this browser. Answering N to “Another game” resets a C64 to BASIC, and the page stops there instead: Start again loads the game afresh. The 10,000th command stops the page too, where on the C64 every text after it is a blank line (How it works).