Jack And The Beanstalk - Colin Carruthers & Ronald Sellar (Your Computer-July 84-Page 100) COLIN CARRUTHERS AND RONALD SELLAR GIVE CLIMBING LESSONS. In this adventure games based on Jack and the Beanstalk you play the role of our intrepid hero Jack; your aim is to recover the three treasures held by the evil Giant who lives in a strange land up in the clouds. The program uses a mixture of text and graphics to represent the locations and objects you find on your travels. Owners of the Currah MicroSpeech unit will be able to hear the Giant's thundering voice. Each location is represented by its own subroutines where all the associated variables are set. These include a location description string, a Help message, and pointers to surrounding locations. Commands are also handled by individual subroutines. These routines check various flags and later those affected by the command. Table 2 gives a complete list of available command verbs. Objects are split into two groups - Those which can be picked up and carried and those which can only be examined. Portable objects have a graphic representation which appears after Look and Inventory commands. Associated with each of these objects are three levels of description, for example: "bag", "money bag" and "a cloth bag full of gold coins". The first two forms are those that can be used in commands like Get Bag or Get Money Bag. The third is the response given by the program to the Examine command. Some special commands are also implemented. These include: Save, Load, Inventory, Recap and Quit. First type in listing 1. This creates 64 user-defined graphic characters which are used in the graphic representation of the portable objects. When this runs without an error message, save the resulting code either to tape by typing GO TO 9990 or to Microdrive cartridge by typing GO TO 9995 Now type in the main program, listing 2. What you do now depends on whether you are using a Microdrive or tape. With a Microdrive simply type GO TO 9995 having inserted the cartridge with the UDG code already on it. With tape it is now necessary to re-load the UDG code saved by listing 1. Do this by typing GO TO 9990 This will load the code and then Save/Verify both the Basic program and the code automatically. TABLE 1. VARIABLES: l(n) Array of flags and object locations. m$(n) Short descriptions of objects. o$(n) Standard descriptions of objects. d$(n) Verbose description of objects. e$(n) Fixed objects that can be examined. e(n) Location of fixed objects. set Current location. l$ Current location description. h$ Current help message. up,do,no,so,ea,we Pointers to surrounding locations i No. of objects carried. i$,a$,b$ Input line, command and parameter. max Maximum number of portable objects. found,sp Assorted flags. n,m General for/next control variables. keys,s$ Currah MicroSpeech variables. TABLE 2. PROGRAM BREAKDOWN: 10 Initialisation 20 Main Loop 500 Command Decode 600 Input routine 700 Prints graphical representation of object n 1000 Location subroutines 3000 Get/Take 3200 Unlock 3400 Examine 3600 Inventory 3800 Open 4000 Wear 4100 Remove 4200 Oil/Lubricate 4300 Dig 4400 Tie 4500 Drop 5000 Break/Smash 5400 Light/Strike 5600 Save 5800 Load 6000 Eat 6200 Drink 6400 Sleep 6600 Caught by Giant 6700 Chop 7000 Main Initialisation 8000 Titles 9000 Game Over 9990 Tape/Microdrive Program save TYPE: Adventure This info file was typed by Michael Bruhn Correction from YC Sep'84, page 33 ---------------------------------- In the July issue the following two lines were left out of listing 1 for the Spectrum Beanstalk program: 1300 DATA 64,255,192,255,64,63,0,0 1500 DATA 1,3,7,14,28,56,112,32