1984 · 4Mation Educational Resources

Flowers of Crystal

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/bbc/flowers-of-crystal with me to Gold.

Cross the river without using a spell, and the game sets a flag that survives starting a new game, so the next game's flight ends at the castle.

01 · The river

Secret: a river crossed without a spell sends the next game to the castle

After the player pays the river's fee, the game offers a spell. Saying no starts the bubble's flight, which is meant to end at the castle. The flag that remembers this survives a fresh start, so in the next game the first flight that gets past its dangers ends at the castle too.

  1. At the river with spells 1, 2 and 3: Do you wish to cross the river? The fee is one spell. Yes.
  2. The fee takes one of the player's spells at random, here spell 3. The Crystal Flower could be close. Do you wish to use a spell? No.
  3. B% is set TRUE and the bubble's flight begins: There is a storm coming.
  4. The game starts again, after the player loses or presses SHIFT-f0. Line 100 resets Z% (the place), S% and T% (the spells) and the six parts of the dream, and leaves B% alone.
  5. In the new game the player reaches the bubble's flight, by chewing the bubble-gum on the walk, and gets past the storm, the cave and the sky spitter.
  6. The flight ends. Z% would be 2, Rumala's Row, but B% is TRUE, so Z% becomes 10, the castle, and B% is cleared.

The variables at each step, read from the computer's memory in jsbeeb. BBC BASIC stores TRUE as −1 and FALSE as 0. Steps 1 to 3 started at the river with Z% at 9 and S% at 7; step 5 started at the flight with B% at −1 and spells 6, 7 and 8, each used to make a danger vanish. A dash is a value that was not read.

The flight ends at line 4052 ($25D9): Z%=2:IFB%=TRUE Z%=10:B%=FALSE. The line sends the player to Rumala's Row, place 2, unless B% is TRUE, when it sends them to the castle, place 10, and clears B%. The river sets B% when the player crosses and then turns down the spell ($3DE9), so that the flight that follows ends at the castle. Only the end of a flight clears it.

A fresh start in part 2 is RUN, which starts the program again, with A% set to 0. Line 100 then clears the progress: the place, the two numbers that hold the spells, and the six parts of the dream. All of these are resident integers, BBC BASIC's 26 variables A% to Z%, which keep their values through a RUN. B% is one too, and survives the RUN like them, but line 100 never clears it. So a player who turns down the river's spell and then loses, to the storm or anything else, starts the next game with B% still set. The next flight that survives its three dangers goes to the castle, where the dream's fourth part is found and the game ends, instead of to Rumala's Row.

02 · Map and Carry

Bug: the 19th look at the map in one place starts the game again

At every place in part 1 the player can type Map or Carry instead of a place to go. Each one leaves a loop open in BASIC, and the nineteenth at the same place is one too many: the game starts again from the beginning, treasures and all.

In jsbeeb, at the Centre's Where do you wish to go next?, Map was typed again and again. BASIC's count of open REPEAT loops, kept in the byte at &24, was 2 at the question and went up by one after each map. The 19th map stopped with error 44 and started the game again at To begin press < S >.

PROCds, the procedure that asks where to go next, asks it inside a REPEAT loop ($2083), a loop that runs until its UNTIL is true. Map shows the map and Carry the belongings, and both then GOTO 480, the line the REPEAT is on. BASIC treats that REPEAT as the start of a brand-new loop and keeps the old one open as well. BASIC II has room for 20 open loops, two are open at the question already, and the 19th look asks for a 21st.

The error is Too many REPEATs, and the game's error handler, ON ERROR A%=0:RUN, turns any error into a fresh start. Every journey ends with RUN, which starts the program again and closes every loop, so the count starts again at each place: a player has to look 19 times without moving. Granny's Garden, by the same author, starts again on the 20th visit to its hallway for the same reason.

03 · Descriptions

Bug: the hippopotamus is never seen

Half the time, a visit in part 2 opens with a description stitched together from nine lists of words. Each list has six words, but the game only ever picks from the first five.

The page's copy of PROCde ($5EBB), with its nine lists read from the DATA at $694B. The crossed-out word in each row is the one RND(5) can never reach.

For each list, PROCde goes back to the start of the list's DATA line with RESTORE and reads RND(5) times, a random number of words from one to five, keeping the last one read. So the word kept is always one of the first five. The sixth words are never read: close to, creepy, secret, castle, yellow, weird, smell, hippopotamus and chasing. The first list is by, near, close to written out twice, so it loses nothing. The seventh is sound, sound, feeling, feeling, taste, smell: something in the air can be a sound, a feeling or a taste, but never a smell.

04 · Fibber's warning

Fibber says three of his instructions are lies, and four are

Before he starts, Fibber of the Lake warns the player: He will give you 6 instructions. 3 of the instructions will be the opposite of what they should be. Four of the six are lies.

InstructionLie or truthThe right choice

The first instruction is line 12150 ($51CF); the other five are the DATA at $56BE, read from the listing, with 1 for a lie and 2 for the truth. In jsbeeb the lie detector said NO to the three lies among the five and YES to the two truths, and Stay was right for the first.

The first instruction, You will have to leave my lake., is always asked, and Stay is the right choice, so it is a lie. Three of the five in the DATA are marked as lies, which makes four. The warning may be one more of Fibber's fibs, but the lie detector cannot check it: the detector only switches on after the first instruction. The questions are on the How it works tab.

05 · Belongings

Bug: "some of your belongings" means all of them

Three hazards in part 1 tell the player that some of their belongings are gone. Each one takes everything.

The eleven items the game keeps in e%, in its order, from the DATA at $6CE5; the messages are lines 3064, 3086, 3092 and 3094. The Pouncer and the Grabbers take the belongings only one time in four, and the buttons show that time. In jsbeeb the Fright Freak, met with a raincoat, a metal detector and a fright stick, left all eleven bytes of e% at 0.

The game keeps the equipment in eleven bytes, e%?1 to e%?11, one for each item the player could carry, where 0 means not carried. Each message is followed by PROCc(11) ($2065), which sets all eleven to 0. The Fright Freak's Some of your belongings are taken back to the Centre. is line 3064, and the Pouncer's The Pouncer takes some of your belongings. and the Grabbers' Some of your belongings are stolen. both go on to line 3092, You will have to continue without them. PROCe, which hands out the equipment at the Centre, starts with the same PROCc(11), so the next visit to the Centre puts things right.

06 · LIST

Secret: LIST shows the copyright and then nothing

Load one of the adventures and LIST it, the command that prints a BASIC program on the screen, and only four lines appear: the first two, then (C) 4MAT 1984 and MIKE MATSON in green, with the bell ringing. After that the screen stays blank.

A BASIC listing of four lines: line 1, line 2, then (C) 4MAT 1984 and MIKE MATSON in green

Part 1 loaded with LOAD"AD1" and listed, in jsbeeb. The operating system's status byte at &D0 then held &80: screen output switched off.

LineBytes after REMOn the screen
3ten bells (7), a quote, green (&82), (C) 4MAT 1984the bell, then the copyright in green
4bells, a quote, green, MIKE MATSON, more bells, then 21the name in green, and code 21 turns the screen off

Lines 3 and 4 ($1920, $193E).

Lines 3 and 4 are REMs, comments that BASIC skips when it runs the program, so their bytes reach the screen only when the program is listed. LIST sends them to the screen as they are: the bell characters (code 7) beep, the code &82 turns the rest of the row green, and code 21 at the end of line 4 is VDU 21, which tells the operating system to ignore everything sent to the screen. The listing carries on, unseen. BASIC stores its keywords as single bytes, and the quote mark after the bells stops LIST from expanding any of the bytes that follow into keywords. The game deletes both lines when it runs, so the trick only guards the program on the disc.

07 · The sky spitter

A vanished danger still says "You are safe." through another IF's ELSE

A vanishing spell used against one of the bubble's flight dangers, the storm, the cave or the sky spitter, skips the danger, and the player is still told You are safe. The words come from the ELSE of an IF that the spell skips as well.

Line 4052, in orderWhen the spitter is thereWhen it has vanished
IFNOTsk%PROCbb: …runs the danger: the bubble (PROCbb) and the spitter's seven shots (PROCgn)the IF is false: BASIC carries on after the line's first ELSE
IFzp PROCzpa shot hit the bubble: ZAP, and the game starts againskipped
ELSEPROCsfYou are safe.You are safe.
Z%=2:IFB%=TRUE Z%=10:B%=FALSERumala's Row, or the castlethe same

Line 4052, the sky spitter's ($25D9); the storm's line 4010 and the cave's line 4048 are built the same way. In jsbeeb, with each danger made to vanish, each said The ... disappears. and then You are safe.

BBC BASIC has no ENDIF, so an IF and its ELSE share one line. When an IF is false, BASIC looks along the line for an ELSE and carries on after the first one it finds, whichever IF it belongs to. Each of the three lines puts its danger inside IF NOT sk%, and the line's only ELSE belongs to the next IF, the one that asks whether the bubble was hit. A vanished danger makes the first IF false, so BASIC jumps to the second one's ELSE: PROCsf, You are safe., the same words a player who dodged the danger gets.

On the spitter's line the same ELSE also holds the end of the flight: Z%=2, Rumala's Row, and the test of B% that sends the player to the castle instead. A flight whose spitter vanished reaches them through the ELSE and ends where a dodged one would (the river's flag).

08 · The story

Bug: on this disc, the story stops at once with Bad program

Choosing 1, the story, from the menu gives Bad program and BASIC's prompt. The file on the disc is saved one byte short.

The menu's screen with Bad program and BASIC's prompt under it

Menu choice 1, in jsbeeb.

The story's first page

The story, after &FF was written at the end of the program, OLD typed and RUN.

A BBC BASIC program ends with the byte &0D and then a byte of &80 or more, which BASIC II writes as &FF. The disc's catalogue, its list of files, gives STORY a length that stops just after the &0D. So the &FF is never loaded, and the byte after the program is whatever was already in memory. In jsbeeb it is &01, which BASIC takes for the start of one more line, and the program stops with Bad program. The other seven programs are saved whole. The disc is a copy, so the short file may be the copy's fault rather than 4Mation's.

09 · The end of part 1

"Press key F to finish" prints END and asks again

Part 1's last screen offers two keys: F to finish and S to start again. F prints END, and then the same two lines come back.

Line 19037 ($6B31), ported key for key. In jsbeeb F printed END and waited at line 19037 again, and S started a fresh game.

Line 19037 waits for a key with GET. S starts a fresh game with A%=0:RUN. F clears the screen, prints the word END and goes back to line 19037, which prints Press key S to start again. and waits once more, now without the F line. Any other key goes back to line 19035, which shows both lines. The program never reaches an END statement, so it never stops, and S is the only way on.

10 · The gum forest

The gum forest's loop never ends by itself

The forest is walked one square at a time inside a loop that is meant to end when a flag called of is set. Nothing ever sets it, so the only ways out are the two kinds of square that leave the forest by themselves: the gold pot's square and a Zap Gate.

FNForest sets of=FALSE as it starts ($499E), and its loop ends with UNTILof ($4CBA), which repeats until of is TRUE. No line sets of TRUE. The gold pot's square ends with PROCf(3) and a Zap Gate with PROCf(RND(8)-1). Each sets the next place and does a RUN, the way every journey ends, and RUN, which starts the program again, is what gets the player out of the loop. One time in eight a Zap Gate picks place 3, the Forest itself, and the player stands outside it again, asked where to go next. Every square is on the Maps tab.