This program is supplied without representation or warranty of any kind.
Philippe Legros, Philippe Maryssael and The Museum of HP Calculators therefore
assume no responsibility and shall have no liability, consequential or otherwise,
of any kind arising from the use of this program material or any part thereof.

Contents

The olden days are no longer and no longer shall they be. The waves of Time
have all engulfed. Is there still anyone remembereth these bygone days when
our land was all covered with vast and dark forests and only vague and hazy
footpaths gave evidence of some furtive presence of man, who feared the
inhospitable world into which he was once brought?... For to protect himself
against that hostile environment whereby he was surrounded, he used to build
up inaccessible and inpregnable castles behind the high and thick walls whereof
he sought some safety and peace. Small communities had scattered about all
over the Earth's surface up to the remotest, most hostile and most arid places.
Yet they eventually managed to survive and knew work, pain, love, boredom,
and even the most terrific evil of all: War. These wars were wars fought
with swords and suits of armour, wars during which Heroism was characteristic
of those brave men fighting hand to hand in restless fights until the enemy's
bloody death...

In this twilight of History man was helpless and his Destiny was dedicated
upon him by Forces beyond his control. Indeed, Mystery and Magic were those
Forces actually making the rules for man who could do nothing but abide by
them on pain of being sentenced to eternal sufferings no medecines, drugs
or curing Philtres of any sort whatsoever could possibly heal. Many a King
had to bow his head to these rules whereof Sorcerers, Witches, Wizards, and
Magicians were the only interpreters effectively reigning with their left
hands and ruling with their right. Over and above these tyranous rulers man's
land was constantly being fought over by Elves, Dragons, Trolls and many
more other types of infernal creatures.

As Time went on by, it little by little altered this scenery: walls proudly
said to be impenetrable had began to crack hither and thither, inviolate
forests had been cleared for cultivation and habitation, Humanism was eventually
born and Mysticism had finally dired up and come to be forgotten by all.
Nothing had remained of that Past save a few gloomy ruins only visited at
night by winter winds and rains. Strange stories, mutilated by long centuries
of Obscurantism, were now and then narrated by some old man puffing his pipe
beside the fire at night's noontime, stories that would come up against our
present materialistic approach of Reality and were about some legendary people
of non-humans fleeing for some safe remote places as some imminent catastrophe
had been fortold, and, so doing, leaving us on our own with our machines,
our dreams and hopes, and our nostalgia of those long-gone days...

The computer program that followeth shall be nothing but a pale reflection
of those long-forgotten Quests by the Knights-errant of old, splendidly and
chivalrously riding up hill and down dale on horseback at the risk of their
lives, with as sole weapons against the evils lying in wait, their unwavering
Faith, their Bravery and Gallantry, their Devotion to the weak, the helpless
and the needy, and their Hopes in a better World to come. Many were called
but very few were chosen, and high was the tribute of the Quest for the Holy
Grail - one of the milestones paving the way for the Philosopher's Stone...
Whereas thou, armed with a keyboard and looking for nothing but entertainment,
thou havest not much at stake but some points thou mightst eventually hap
to lose! Thou shalt have a furtive glimpse of the first step towards Initiation:
a nameless Castle drowned in Nothern haze. No-one ever liveth there, yet
the place is swarming with hordes of mysterious 'life-forms'. Many an intrepid
Knight used to venture into the Castle but very few were those who came out
of it alive. Yet all these Blest Survivors actually managed to gain control
over the base impulses and motives of their animal natures and to come out
transformed, dignified. The Castle, consisting in an infinite and lethal
Maze, concealeth the Holy Golden Grail. So, Humility, Perserance, Patience
and rigorous Logic shall be the four Essences constituting the Sacred Ring
of thine ultimate Victory. Each time thou wilt start combating, each time
thou wilt give up the ghost, each time thou wilt discover a treasure, please
bear in mind that several centuries back young Valiant Knights used to experience
it far more invensely...

Your initiation starts when you wake up inside the Castle in a cold, damp
and bare cell, cell 0. Then you can choose amongst three directions: three
dark and narrow passages. At the very end of each of these three tunnels
you know there are three new cells. About their contents you only hear vague
rumours. And you can from time to time manage to find out what their actual
contents are. Sometimes some pieces of information are to be found in the
very cell you are in: an old, long-forgotten signpost torn apart and away
and trampled underfoot reporting some lethal hazard (ACID BATH) or the nearness
of a welcome help (WIZARD). Unfortunately, these signposts never show the
accurate direction and rumours are echoed so many times by these dark places
that it just is not possible to have a true idea of their actual meaning.
Moreover some indications can be put aside by you and in this case the danger
lurking you is greater...

Whatever the case may be, you came to move if only at least to find the exit.
Waiting for death to come and take you away is no solution. So for your moves
there are each time six possibilities: either take one of the three corridors
leading to a new cell, by choosing amongst them the one presenting the smallest
danger of course; or use the Magic Stone which you received when entering
the Castle and by so doing move in a second's time upwards or downwards within
a space of torus-shaped spirals making up one storey of one hunderd
interconnected cells. Cell 0 is the lower point (DOWN is inefficient in this
case) and cell 99 is the upper one (UP is not efficient in this case) - this
might appear to be strange as cells 0 and 99 are connected to one another;
yet it all is normal as the Castle does not belong to the three dimensional
world in which man lives although its external appearance is that of a standard
castle as there were many in the Middle Ages; and this combination of Earthly
and Suprahuman features gives evidence of the Sapience of old. This Stone
may appear to be very practical but unfortunately has its whims and vagaries:
it will always rematerialize you randomly in one of the upper of lower cells
(according to your choice - UP or DOWN). And you will have to bear all the
consequences of your upwards or downwards random transportation: you may
find yourself face to face with a dragon, a clique of rabid rats, or - which
is more agreeable indeed - a sexy little witch coming to you to give you
a helping hand. A sixth and last moving method is offered to you: go back
to the last cell you were in (BACK - not available when you wake up in the
Castle and have not made one move at least). This BACK option may reveal
itself very useful especially after using the Magic Stone for moving up or
down. Indeed, it is the only means at your disposal to move back to a safe
'home base'.

When you move to a new cell several possibilities are presented to you. You
can end up in an empty cell with nothing at all threatening you and you can
then proceed in any of the six possible directions. Note in connection with
this that there are only five possible directions in the case of a FORK,
in which the cell you are in has only two corridors leading to two cells
randomly chosen and changing at each visit of the FORK cell. In the case
of a FORK the BACK option is still available. Besides the two corridors,
leading sometimes very remote cells in the Castle, are so dark and tortuous
that no single indication about the cells they are leading to is available.
So you move to them at your own risk.

You can also fall into a lethal trap (ACID BATH, GHOSTS, GUILLOTINE or
PORTCULLIS). Unless you have the MAGIC ELIXIR in your equipment, you will
die in an atrocious way and put a sad end to your Quest and end up in the
Graveyard of the One Thousand Vanquished, save if you have been dissolved
in the ACID BATH, in which case a grave is no longer necessary. Note that
the MAGIC ELIXIR will bring you back to life only once, and you will consequently
have to find another flask of this priecious liquid to render yourself immune
to any of these lethal hazards.

There exists another kind of trap you can also fall into: a kind of trap
in which the ground is giving way beneath you. In this case you move to another
storey of one hunderd cells (TRAP, HIDDEN HOLE). In order to move to another
storey, you can be asked to enter the three-digit key given by the first
WIZARD come across. Other traps may require that you use some pieces of your
equipment (if you still have them at your disposal of course!): e.g. a LOCKED
DOOR for which the KEYS are necessary. Hither and thither monsters may run
at you, in which case you would need a weapon to drive 'em back. It is generally
at that very moment that BATS turn out to snatch some piece of your equipment.

Remember that when in the situation in which a riposte from you with one
of the pieces of equipment still at your disposal, you have only two attempts
to react successfully. If you fail you just cannot take to your heels and
have to bear all the - possibly lethal - consequences arising out of the
situation. In the case of success your way is clear and you can proceed your
Quest. In the case of aborted ripostes you will fall into another storey,
be killed by your aggressor (if you have the MAGIC ELIXIR you will survive
once), or be forced back whence you came (GO BACK).

In the course of your tumultuous peregrinations thru the Castle you will
come across wizards and witches, whose services can be most helpful to you.
Do not avoid visiting them! A wizard will give you indications on the contents
of three cells of your choice, and a witch will reveal you the content of
one cell. Yet their powers are limited and they can't see everything that's
in a cell. Moreover, the first wizard you will come across will give you
a vital information for he rest of your Quest: a key (three-digit secret
number) allowing you to take the STAIRS and move to a new storey without
any harm, and to take possession of the Holy GOLDEN GRAIL, the ultimate goal
of your Quest. But do be on the qui vive when visiting a wizard or a witch
because many a horrid creature is creeping in these cells to jump at you
unawares. So watch out!

Apart from that you won't only make disagreeable and hostile encounters in
the Castle. In certain cells you will come across pleasant little things,
sometimes funny but never of great help to you (BARKING TREE, WOOING EYES,
PEEPING GIRL, ...). You will also find useful things such as valuables and
some piece of equipment. Take great care of their guardians who are often
very near: traps, ferocious animals... The pieces of equipment you will find
along your way will be added to your actual equipment for later use. They
will also be at the mercy of the bats. At this stage a remark should be made
about your equipment: when entering the Castle you have only four pieces
of equipment (SWORD, TORCH, KEYS, and SPIRIT) which can only be used to riposte
to some traps or attack by fierce animals; but four additional pieces of
equipment (MAGIC ELIXIR - to bring you back to life once if you happen to
die from a lethal hazard -, MAGIC ARMOR - also for ripostes -, MAGIC WAND
- to return you the SWORD, TORCH and KEYS on request if they have been snatched
by the bats -, and last but not least MAGIC EXIT - the only means to leave
the Castle at any moment except during a riposte!) are scattered around for
you to pick them during your Quest. Bear in mind that any of these eight
pieces of equipment can be snatched by the bats, and that your final score
is going to be calculated on the basis of the valuables and GOLDEN GRAIL
picked up and of the time you wandered around in the Castle (if your calculator
have the Time functions). So, before leaving the Castle, pick up a maximum
of valuables and try and find the GOLDEN GRAIL!

A few words about these valuables you can pick up along your way: they are
directly pickable after a possible riposte against their guardians. These
valuables, ranging from sceptres to rings, originate from various human dynasties
dating back to more or less remote areas and are hence a certain amount of
points worth, this amount of points depending upon their age. Here follow
these dynasties: Kish (3500 BC - 3000 BC, Sumerians), Our (2200 BC - 2000
BC, Sumerians), Mari (2000 BC - 1600 BC, Amorrites), Hia (2000 BC - 1500
BC, Chinese), Song (960 BC - 390 AD, Chinese) and Ming (1368 AD - 1432 AD,
Chinese). Last but not least comes the most important valuable to pick up:
the GOLDEN GRAIL for which the key given by the first wizard come across
is necessary. So don't forget this key. Moreover, the GOLDEN GRAIL is ALWAYS
accompanied by a guardian sometimes benevolent, sometimes malevolent, and
lots of bats...

Now we've come to the end of this short description of what awaits you in
the Castle, we shall conclude it with the way the score is calculated. First
of all, you can, at any moment during your Quest, call your running score,
except during a riposte. In this running score the points of all the valuables
picked up along your way thru the Castle are added up (MING RING is 100 points
worth while KISH SCEPTRE is 1800 points worth). As far as the GOLDEN GRAIL
is concerned, it is 5000 points worth. The goal of the game, apart for staying
alive and getting out safe, is to total up to 15,000 points. When you eventually
leave the Castle with the MAGIC EXIT, this score will be used to compute
your final score in percentage points (100 points being almost impossible
to reach). This final score will reflect your dergree of aptitude and ability
during your Quest. There are two different ways of computing your final score:

- Either the time elapsed is not taken into consideration: in this case your
final score is calculated solely with your running score reduced to a portion
of a total of 100 points.

- Or this time is taken into consideration: in this case your running score
counts for 70% of your total of 100 points. The remaining 30% are allocated
to your response time. If this time lies between 0 and 3 minutes, 30 points
are added to your total; afterwards these 30% decreases on a linear basis
to reach 0 point at time 4 min 48 sec. Over this time you will lose points
from the 70% part. So you'd better not hang around idly.

The program is initialized before the ALPHA message "Seed?" appears. Initializing
takes about six seconds. The display of a "NONEXISTENT" message means that
the SIZE needed to run the program is not sufficient (the minimum SIZE should
be 20).

Generating one storey of 100 inter-connected cells takes up between 13 and
20 seconds. In the meantime the following messages can appear: - the program's
title "THE CASTLE" when initializing the program at the beginning of your
Quest; - "YEEIII..." if you fall from the current storey into another one;
- " " or "HIDDEN HOLE" if you move to another storey willingly
or not.

Running the program just after it has been keyed in is quite slow. This
disappears when the GTO / XEQ compilations have been performed.

Keying in a same seed will give you the same storey of cells when entering
the Castle. Yet the contents of the cells will be modified progressively
on the basis of your reactions and possible rispostes.

When you are SAFE, "p* d1 d2 d3" is displayed after the possible warnings.
Just press any of the numbers d1, d2 or d3 to move to that cell ar any of
the A thru E, a, d or e program commands. The F thru J riposte keys are disabled.

When you have to riposte, "p* ?" is displayed and you have to press any of
the F thru J riposte keys. All the other program commands being disabled.

If you try to move to a cell you cannot go to the message "ILLEGAL CELL"
is displayed and then "p* d1 d2 d3" is displayed again. This remark is also
applicable for the FORK cells.

When you come across a WIZARD or a WITCH, "CELL ?" is displayed and indicates
you have to enter the cell number you want to visualize the contents of.
This number must be comprised between 0 and 99 inclusive. For any number
out of this range INT(ABS(number)) is used to standardize it between 0 and
99.

A Quest lasts about half an hour. Don't power off the calculator: the program
uses flags 11 thru 20. If present, the Time stopwatch cannot be stopped.
Otherwise precious information will be lost.

If you don't want to use the stopwatch, you can avoid using it by clearing
flag 25 when the "Seed?" message is displayed.

2e: To start the Quest. You will enter CELL 0 of one storey.
FUNCTION KEYS: [R/S]
OUTPUT: THE CASTLE

3: When safe and sound in cell p (p standing for position).
OUTPUT: SAFE ... warnings (ø)... p* d1 d2 d3
(ø) The warnings are all the hazards (some hazards, which are never
lethal, are not reported, nor are the valuables, the pieces of equipment
to be collected and the distractors) to be found in cells d1, d2 or d3.
Then go to point: 4, 5, 6, 7, 8, 9, 10, 11 or 12a.

4: To visualize the warnings when not in case of a FORK.
FUNCTION KEYS: [a]
OUTPUT: warnings ... pø d1 d2 d3
Then go to point 4, 5, 6, 7, 8, 9, 10, 11 or 12a.

6: To randomly move to a new cell the p' code of which is superior to the
p code (p<p'<=99).
FUNCTION KEYS: [B]
Then go to point 12b.

7: To randomly move to a new cell the p' code of which is inferior to the
p code (0<=p'<p).
FUNCTION KEYS: [C]
Then go to point 12b.

8: To move back to the cell whence you came.
FUNCTION KEYS: [D]
Then go to point 12b.

9: If you want to put an end to your Quest, and if you have the MAGIC EXIT,
leave the Castle.
FUNCTION KEYS: [d]
Your performance in the Castle during your Quest is globally estimated between
0 and 100 points. If you picked up the GOLDEN GRAIL the + sign is appended
to your points.
OUTPUT: -THRU ALIVE- ... POINTS: xx
To start a new Quest:
FUNCTION KEYS: [R/S]
OUTPUT: Seed?
Then go to point 2b.

11: If you lost your SWORD, LAMP and/or KEYS, and if you have the MAGIC WAND,
use the WAND key to get them back.
FUNCTION KEYS: [e]
OUTPUT: MAGIC WAND ... EQUIPMENT: ... p* d1 d2 d3
Then go to point 4, 5, 6, 7, 8, 9, 10, 11 or 12a.

12a: To go from cell p to any of the three adjacent cells d1, d2 or
d3.
FUNCTION KEYS: d1 or d2 or d3
OUTPUT: MOVING TO ...

12b: When moving to a new cell you are confronted with various possibilities.

12b.1: The new cell is empty: nothing to report. Go to point 3.

12b.2: The new cell contains a hazard.
OUTPUT: hazard

12b.2.1: This hazard is lethal and no riposte is possible.
OUTPUT: - DEAD -

12b.2.1.1: If you haven't got the MAGIC ELIXIR, you are definitely dead and
your calculator shuts off. For a new Quest, turn it on again.
OUTPUT: Seed?
Then go to point 2b.

12b.2.1.2: If you have the MAGIC ELIXIR, you come back to life but loose
the MAGIC ELIXIR.
OUTPUT: MAGIC ELIXIR
Then go to point 3.

12b.2.2: The hazard requires your riposting. In this case BATS may come and
snatch some piece of your equipment.
OUTPUT: BATS SNATCH ...
Then a riposte is being waited for.
OUTPUT: p* ?

12b.2.2.1: Select the most adequate riposte.
FUNCTION KEYS: [Key]
Key is F for SWORD, G for TORCH, H for keys, I for ARMOR and J for SPIRIT.
Then go to point 12b.2.2.2.

12b.2.2.2: Reaction.

12b.2.2.2a: If you haven't got the piece of equipment used to riposte and
if it is your first riposte.
OUTPUT: NO ... p* ?
Then go to point 12b.2.2.

12b.2.2.2b: If you haven't got the piece of equipment used to riposte and
it is your second and last riposte.
OUTPUT: NO ... MISSED
Then go to point 12b.2.3.

12b.2.2.2c: If you have the piece of equipment used to riposte and if your
riposte is efficient.
OUTPUT: ... USED
Then go to point 3.

12b.2.2.2d: If you have the piece of equipment used to riposte, if your riposte
is not efficient and if it is your first riposte.
OUTPUT: ... USED ... MISSED ... p* ?
Then go to point 12b.2.2.

12b.2.2.2e: If you have the piece of equipment used to riposte, if your riposte
is not efficient and if it is your second and last riposte.
OUTPUT: ... USED ... MISSED
Then go to point 12b.2.2.3.

12b.2.2.3: Neither of your ripostes has been efficient.

12b.2.2.3a: The hazard was lethal.
OUTPUT: - DEAD -
Then go to point 12b.2.1.1. or 12b.2.1.2.

12b.2.2.3b: The hazard was not lethal. So you have to go back whence you
came.
OUTPUT: GO BACK
Then go to point 12b.

12b.2.2.3c: The hazard makes you move to the same cell in another storey
of cells.
OUTPUT: YEEIII...
Then go to point 12b.

12b.2.3: The hazard does not require your riposting but makes you move to
another storey.

12b.2.3a: In the case of a HIDDEN HOLE you sometimes end up in cell 0 of
the new storey.
OUTPUT: HIDDEN HOLE
Then go to point 3.

12b.2.3b: You can also end up in cell p of the new storey.
OUTPUT: YEEIII...
Then go to point 12b.

12b.2.4: You are in the case of a FORK and two directions are possible (d1
and d2) but you cannot know what their contents are.
OUTPUT: FORK ... p* d1 -- d2
Then go to point 5, 6, 7, 8, 9, 10, 11 or 12a.

12b.2.5: It's a hit, you've found the GOLDEN GRAIL.
OUTPUT: GOLDEN GRAIL ... KEY?
Now you have to key in the three-digit key given by the first WIZARD you
came across.
INPUT: 3-digit key

12b.2.5a: The key is correct and the GOLDEN GRAIL is yours.
OUTPUT: SCORE : xxx
You win 5,000 points and a new hazard is presented to you. Then go to point
12b.2.

12b.2.5b: The key is wrong and you can't have the GOLDEN GRAIL. Go to point
3.

12b.2.6: You come across a WIZARD. If it is the first WIZARD you come across,
he gives you a three-digit key. You can then ask him to show you the contents
of three cells (but mind WIZARDs can't see everything that's in a cell!).
Enter three value for xx (between 0 and 99 inclusive) in a row each time
the question "CELL ?" is asked.
OUTPUT: WIZARD ... (KEY: xxx ...) CELL ? (thrice)
INPUT: xx
OUTPUT: CELL xx : ... (thrice)
Then go to point 12b.

12b.2.7: You come across a WITCH. You can ask her to show you the contents
of one cell (xx) but she can't see everything that's in a cell
either.
OUTPUT: WITCH ... CELL ?
INPUT: xx(once)
OUTPUT: CELL xx : ... (once)
Then go to point 12b.

12b.2.8: You are in front of a flight of STAIRS. To be allowed to use it,
you have to key in the three-digit key given by the first WIZARD came
across.
OUTPUT: STAIRS ... KEY?
INPUT: 3-digit key

12b.2.8a: The key is correct. You move to cell 0 in a new storey.
OUTPUT: ...
Then go to point 3.

12b.2.8b: The key is wrong. In this case go to point 12b.1. or 12b.2. for
a non-lethal hazard.

12b.3: The new cell contains a valuable.
OUTPUT: Valuable ... SCORE : xxx
If there is a new non-lethal hazard, go to point 12b.2. If there is no new
hazard, go to point 3.

12b.4: The new cell contains one piece of equipment. It is added to your
equipment for later use.
OUTPUT: Equipment
Then go to point 3 if no new hazard or to point 12b.2. if new, non-lethal
hazard.

12b.5: The new cell contains a funny little distractor.
OUTPUT: Distractor
Then go to point 3.

System configuration

Program status

SIZE 020
Trig mode: DEG
User mode: ON (under program control)
Number of program steps: 879
Number of program bytes: 2068
Total number of registers (program+data): 316
Number of mag sides (card reader): 19