THIS OLD HOUSE
by N Kidd
from ZX Computing Dec'84/Jan'85

This old house still has a few surprises for the unwary.
Enter N Kidd's program and enter the house - if you dare!


There are a lot of adventure games currently available on
mail order (most are rather expensive) but a distinct lack
of such games in magazines. This is just one of the reasons
why I have written this game for the 16K ZX81. There are
several others! Firstly, I think people should enjoy playing
the game and at the same time learn more about programming
technique; secondly, I need the money!

The idea of the game is that the player finds himself
transported to an old house and must escape, but find the
password and #100 before he reaches the exit. Just to make
it difficult, he will encounter various problems on his way
such as darkened rooms, locked doors and no floor but I will
not reveal any more - it's up to you to find out with the
aid of the instructions.

With a little knowledge of computing, a key to the variables
I have used and a guide as to what each part of the program
does, the game is easily adaptable and a lot of fun. Honest!


Variable use

M$(,)     Monster string - holds the 30 monsters names
W$(,)     Weapons string - holds the 10 weapons you could find and use
T$(,)     Treasure string - holds the different types of hidden treasure
O$(,)     Object string - holds the 9 objects to aid you on your journey
P$(,)     Password string - holds the 9 different passwords that could be chosen
Q$        Today's password
R$        Your present weapon
A$(1)     Your 'guess' at today's password
A$        'Does all the work' string
E$,K$,L$  Memory saving strings (saves printing out statements many times)
I$(4)     Objects you can use
T         The amount of treasure you can have (in #)
I         Injuries incurred during battle
E         Energy at present
W         Weapon code (R$ = W$(W))
S         Fight strength (depends on W, I and E)
AA,BB     Your location on the screen from the 'AT' command
AAA,BBB   Direction in which to move (representing cursor numbers)
L         CHR$ L = abbreviated character for either dark room, no floor or exit
MS        Strength of monster
A         What will happen to you this turn? (in line 1440)
S$(64)    Will clear two lines of print but not destroy the rest of the display
          as CLS does (note S$(to 32) will only clear one line)
KK,Z,WWE, Less important, hard working variables sometimes 
F,K,G,X,A,doing more than one job
B,OO


Structure of the program

Lines	Function
10-60      Defines monsters' names using ZX81 READ/DATA routine
           [Not very likely, as the ZX81 does not have READ/DATA commands. JimG.]
65-120     Defines weapons
120-145    Defines types of treasure
150-200    Defines objects that you may find
205-240    Defines password
260-355    Sets up screen display of house. Note the part that prints and then
           later PEEKs the screen for these asterisks and changes them to an
           open/closed door or a thin wall
370-380    Inputs user's command
400-418    Wait routine
425-900    Move routine. Is it open/closed door or thin/outside wall? If so has
           the player the necessary object to pass? If Y then look out for a
           darkened room etc., or the possibility of one coming soon
915-1005   Broken object routine. (Remember L$ = "So you throw it away")
1010-1014  If lucky print today's password for a few seconds
1030-1036  Broken weapon, find a less dangerous one
1110-1114  Oh! back to the beginning
1200-1235  Prepare monster data
1240-1426  Battle with the monster
1410-1670  Finding an object
1710-1770  Finding a weapon
1780-1981  Using an object
2000-2080  Reaching the exit - the tests
9000-9095  Print the instructions page by page
9100-9130  Your new status (as a GOSUB routine)
9900-9930  Setting up variables
9990-9994  Saving program during running


Now you should be able to adapt the program to your own
requirements or add a few more objects, but watch out for
memory overflow! To give you some idea of how this is done,
the following is an example of how to put another word into
the repetition of the password for today.

1) For another four letter word (a respectable one!)
   Edit line 205 and place the new word directly after SNAP
   Edit line 210 and change it to P$(10,4)
   Edit line 215 and change it to F = 1 to 10
   Edit line 9990 and change it to A = INT(RND*10)

2) For a six letter word eg. PIRATE
   Edit line 205, adding two spaces after every word and
   place the new word after SNAP..Pirate.
   Now carry on as for 1) but substitute the 4 in line 210 for a 6.

Simple but effective isn't it? Once you have got the hang of
it you could almost completely change the program.

[The remaining paragraphs give misleading instructions for converting the]
[game for the ZX Spectrum, and incorrect instructions for entering the   ]
[graphics characters, so I've missed them out.                           ]
[Despite the author's suggestions, the game cannot easily be converted   ]
[for the Spectrum, as it uses graphics characters which have no Spectrum ]
[equivalents, and uses ZX81-specific techniques for finding character    ]
[locations on-screen which cannot be easily emulated on the Spectrum (as ]
[SCREEN$ cannot be used for locating graphics characters).          JimG.]


--
Another Fine Product transcribed by:
Jim Grimwood (jimg@globalnet.co.uk), Weardale, England
--
