--- title: "Jack and the Beanstalk" id: 71959 type: "computer_media" slug: "jack-and-the-beanstalk" url: "http://localhost/computer_media/jack-and-the-beanstalk/" markdown_url: "http://localhost/computer_media/jack-and-the-beanstalk.md" published_at: "2026-10-20T14:28:20+00:00" modified_at: "2026-10-20T14:28:21+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2022/04/20230809-041332.jpg" excerpt: "A text adventure in which Jack trades the cow, climbs the beanstalk and steals the giant's goose, harp and gold, with UDG pictures of each object carried." category: - name: "Archived Media" slug: "archived-media" taxonomy: "category" url: "http://localhost/category/archived-media/" post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "TS 2068" slug: "ts2068" taxonomy: "post_tag" url: "http://localhost/tag/ts2068/" model: - name: "Timex/Sinclair 2068" slug: "ts-2068" taxonomy: "model" url: "http://localhost/model/ts-2068/" genre: - name: "Game" slug: "game" taxonomy: "genre" url: "http://localhost/type/game/" media_contents: - id: 71965 title: "Long Island Sinclair Timex (LIST) User Group Library Tape #3.5" type: "computer_media" url: "http://localhost/computer_media/long-island-sinclair-timex-list-user-group-library-tape-3-5/" media_type: "Program" tsrun_member: "LIST LIB 3.5 (198x)(Long Island Sinclair Timex User Group)(TS2068)(US)(Cassette)/List_Lib_3.5B(Unk)(Unk)(TS2068)(Cassette)/13_Jack.tap" mediadate: "1984" media_type_tags: "Game" --- # Jack and the Beanstalk A text adventure that follows the fairy tale. Jack starts in his mother’s cottage with orders to sell Daisybell the cow, and must eventually climb the beanstalk and bring back the giant’s three treasures: the magic goose, the golden harp and the bag of gold coins. Commands are typed as verb and noun and include go, get, drop, examine, open, unlock, oil, dig, tie, wear, light, drink, eat, sleep and chop, plus help, inventory, and saving and loading a game in progress. Locations include the village, a church, a quarry, a golf course and the rooms of the giant’s castle, with a safe that needs a combination. Each object in the inventory is shown with a two-by-two UDG picture. From Your Computer, July 1984, written by Carruthers and Sellars and entered by F. Chrysler. This program is on side B of the Long Island Sinclair Timex (LIST) user group library tape #3.5. The program is followed by its 512-byte graphics block, `Jack.udg`, and by a second file named `jack.udg`: a short BASIC program, also credited to Your Computer and F. Chrysler, whose REM says “here’s how those nice udg’s got entered in the first place”. It pokes the same 512 bytes into 60000-60511 from `DATA` lines while keeping a running total. ## Program Analysis ### Program Structure - Lines 10-100: the room display and the input loop. Each location is a subroutine at a line number (1000, 1050 … 2950) that sets `l$` to its description and the exits `no`, `so`, `ea`, `we`, `up` and `do` to destination line numbers. - Lines 100-499: verb dispatch; movement does `LET set=so` and so on, then reruns the room routine. - Lines 500-530 and 600-650: parse the input into verb and noun, and a custom line editor with a `_` cursor and key click. - Lines 3000-6800: handlers for each verb. - Lines 5600-5840: save and load the game state with `SAVE "Jack" DATA l()`. - Lines 7000-7465: read object names, descriptions and UDG colors from `DATA`. - Lines 8000-8260 and 9000-9080: title screen with a randomly grown beanstalk, and end-of-game scoring by treasures recovered. ### Object Graphics Each object has 32 bytes of graphics in the block at 60000. Before an object is printed, its address is poked into the UDG system variable (23675/23676), so `CHR$ 144` to `CHR$ 147` show that object’s picture in four colors taken from `c(n,1..4)`. ### Notable Techniques - Room numbers are line numbers: `GO TO set` enters the current location’s subroutine directly. - Object locations are kept in the array `l()` as room line numbers, 0 for carried and -1 for worn, so a save game is one numeric array. - The safe’s combination is entered on a dial drawn with `CIRCLE`; two particular wrong combinations set off an explosion effect. ### Potential Issues - The tape copy contains the program twice in succession; the decoded listing shows lines 1-9 again after line 9998. - Line 9996 holds commented-out Microdrive save commands from the Spectrum original. - In the separate graphics entry program, line 9991 saves `CODE 6000,512` instead of 60000, so it would save the wrong part of memory. ## Source Code ``` 1 REM *********************** 2 REM * JACK and the * 3 REM * BEANSTALK * 4 REM * Your Computer * 5 REM * July 1984 * 6 REM * entered: F. Chrysler* 7 REM * written by * 8 REM * Carruthers & Sellars* 9 REM *********************** 10 LET a$="": LET i=0: LET set=1000: LET pre=0: LET keys=0 15 POKE 23609,10: BORDER 0: PAPER 1: INK 7: GO SUB 8000 20 LET l(25)=1: LET h$="You're doing fine, Jack.": LET no=0: LET we=no: LET ea=no: LET so=no: LET up=no: LET do=no 30 GO SUB set 35 IF l(20)=1 THEN LET e(4)=set 40 CLS : PRINT 'l$ 42 IF NOT l(3) THEN LET s$="ff(ee) ff(ii) ff(eau) ffum (ii)smel(th)(ee)bluud of an ingli(sh)man": PRINT '"A thundering voice just behind you says...."''" Fee Fi Fo Fum,"'" I smell the blood"'" of an Englishman." 45 IF e(4)=set THEN IF set<>1250 THEN PRINT "Daisybell the cow is here." 50 IF l(20)=2 THEN LET l(20)=0: PRINT "A strange man wearing a white hat and a butcher's apron says 'Aha !! Just what I need.' He takes 'Daisybell' and before youcan do anything he disappears, leaving some beans on the path." 55 IF NOT l(25) THEN PRINT "It's too dark to see anything.": GO TO 100 57 IF l(25)=2 THEN LET l(25)=0 60 LET found=0: FOR n=1 TO max: IF l(n)<>set THEN NEXT n: GO TO 90 63 IF NOT found THEN PRINT : PRINT "You can see..": PRINT : LET found=1 65 GO SUB 700 70 NEXT n 75 GO SUB 700 80 GO TO 100 90 IF (a$="look" OR a$="l") AND NOT found THEN PRINT "You can't see anything special" 100 BEEP .01,10: GO SUB 600: IF i$="" THEN GO TO 100 102 FOR n=1 TO LEN i$: IF i$(n)<="A" AND i$(n)>="z" THEN LET i$(n)=CHR$ (CODE i$(n)+32) 103 NEXT n 105 GO SUB 500 107 IF pre=set THEN GO TO 6600 109 IF NOT l(3) THEN LET pre=set 110 IF a$="go" THEN LET a$=b$: LET b$="" 115 IF (a$="n" OR a$="north") AND no THEN LET set=no: GO TO 20 120 IF (a$="s" OR a$="south") AND so THEN LET set=so: GO TO 20 130 IF (a$="w" OR a$="west") AND we THEN LET set=we: GO TO 20 140 IF (a$="e" OR a$="east") AND ea THEN LET set=ea: GO TO 20 150 IF (a$="d" OR a$="down" OR a$="descend") AND do THEN LET set=do: GO TO 20 155 IF (a$="u" OR a$="up" OR a$="climb") AND up THEN LET set=up: GO TO 20 160 IF a$="recap" OR a$="r" THEN GO TO 40 170 IF a$="help" OR a$="h" THEN PRINT h$: GO TO 100 180 IF a$="take" OR a$="get" THEN GO TO 3000 190 IF a$="put" OR a$="drop" THEN GO TO 4500 210 IF a$="look" OR a$="l" THEN GO TO 55 220 IF a$="examine" OR a$="ex" OR a$="read" THEN GO TO 3400 230 IF a$="save" THEN GO TO 5600 240 IF a$="load" THEN GO TO 5800 250 IF a$="inventory" OR a$="i" THEN GO SUB 3600: GO TO 100 260 IF a$="sleep" THEN GO TO 6400 270 IF a$="tie" THEN GO TO 4400 280 IF a$="wear" THEN GO TO 4000 290 IF a$="quit" THEN GO TO 9000 300 IF a$="remove" THEN GO TO 4100 310 IF a$="oil" OR a$="lubricate" THEN GO TO 4200 320 IF a$="unlock" THEN GO TO 3200 330 IF a$="open" THEN GO TO 3800 340 IF a$="dig" THEN GO TO 4300 350 IF a$="eat" THEN GO TO 6000 360 IF a$="light" OR a$="strike" THEN GO TO 5400 370 IF a$="smash" OR a$="break" THEN GO TO 5000 380 IF a$="drink" THEN GO TO 6200 390 IF a$="chop" THEN GO TO 6700 490 IF LEN a$=1 THEN PRINT "You can't !": GO TO 100 499 PRINT "You can't ";a$;" ";b$;" !": GO TO 100 500 IF i$(1)=" " AND LEN i$>1 THEN LET i$=i$(2 TO ): GO TO 500 502 LET sp=0: LET a$="": LET b$="": FOR n=1 TO LEN i$ 505 IF i$(n)=" " AND NOT sp THEN LET sp=1: GO TO 520 510 IF NOT sp THEN LET a$=a$+i$(n) 515 IF sp THEN LET b$=b$+i$(n) 520 NEXT n 530 RETURN 600 POKE 23692,255: LET i$="" 610 LET xat=25-PEEK 23689 612 IF xat>21 THEN LET xat=21: PRINT : PRINT 615 PRINT INK 6;AT xat,0;")";i$;"_"; 620 PAUSE 0 625 LET a$=INKEY$ 627 IF a$="" THEN GO TO 620 628 BEEP .004,34.4 630 IF CODE a$=13 THEN PRINT INK 6;AT xat,0;")";i$;" ": RETURN 635 IF CODE a$=12 AND i$<>"" THEN LET i$=i$( TO LEN i$-1): GO TO 615 645 IF (a$<"A" OR a$>"z") AND a$<>" " THEN GO TO 620 647 IF LEN i$>25 THEN BEEP .1,-10: GO TO 620 650 LET i$=i$+a$: GO TO 615 700 LET addr=60000+(n-1)*32 710 POKE 23675,addr-256*INT (addr/256) 720 POKE 23676,INT (addr/256) 725 POKE 23692,255 730 PRINT " "; INK c(n,1);CHR$ 144; INK c(n,2);CHR$ 145 740 PRINT " "; INK c(n,3);CHR$ 146; INK c(n,4);CHR$ 147; INK 7;" ";o$(n) 745 PRINT 750 RETURN 1000 LET l$="You are inside a small, barely furnished room. To the south is a door leading into the garden and to the north is the front door." 1003 IF l(26) AND l(2) THEN LET l$=l$+" Your Mother is asleep in the corner." 1005 IF NOT l(26) THEN LET l$=l$+" Your poor Mother says 'Take our cow to the market and sell her, Jack.'": LET l(26)=1 1007 IF l(26) AND NOT l(2) THEN LET i=i-1: LET l$=l$+" Your Mother is very,very angry. She says 'You bad, stupidboy. Now we shall starve.' In her anger she throws the beans out of the window.": LET l(2)=9999: LET l(18)=1 1020 LET no=1050: LET so=1400 1030 RETURN 1050 LET l$="You are just outside the cottage. A dusty path leads to the east and a sign pointing west says 'To The Church.'" 1055 IF l(19) THEN LET h$="Going up ?": LET l$=l$+CHR$ 13+"There is a large green beanstalkrising up into the clouds !": IF l(7)+l(14)=-2 THEN LET up=1550 1060 LET we=2950: LET ea=1100: LET so=1000 1070 RETURN 1100 LET l$="You are on a dusty road leading east to west with an opening to the north. There is a pool of oil on the ground." 1120 LET we=1050: LET ea=1150: LET no=2850 1130 RETURN 1150 LET l$="You are in some woods. The dusty road continues east to west, there is a clearing to thenorth and a small hill to the south." 1155 IF l(20) AND RND>.75 THEN GO SUB 5500 1170 LET no=2900: LET we=1100: LET so=1350: LET ea=1200 1180 RETURN 1200 LET l$="More woods. The dusty track nowruns north and south. Sounds (and smells) of farm animals drift from the south. A sign tothe east says 'No Fishing'." 1205 IF l(20) AND RND>.75 THEN GO SUB 5500 1220 LET ea=3150: LET no=1150: LET so=1250 1230 RETURN 1250 LET l$="The market. There are lots and lots of farmers and farm animalsto be seen." 1255 IF l(20) THEN LET l$=l$+" No-one seems to be interested in 'Daisybell'." 1270 LET no=1200: LET so=1300 1280 RETURN 1300 LET l$="You are at the foot of a small hill just outside the market. A path to the west climbs the hill." 1305 IF l(20) AND RND>.75 THEN GO SUB 5500 1320 LET up=1350: LET ea=1250: LET we=1350: LET no=1200 1330 RETURN 1350 LET l$="You are at the top of the small hill. To the east you can see the market and to the north is your cottage." 1370 LET no=1150: LET ea=1300: LET we=1400: LET do=1300 1380 RETURN 1400 LET l$="You are in the back garden at the foot of the hill. The houseis to the north, your garden shed is to the east and paths lead south and west." 1420 LET no=1000: LET up=1350: LET ea=2800: LET so=1450: LET we=1500 1430 RETURN 1450 LET l$="Beside a waterfall. There is a pool of clear water to the west.To the north is a church and a path leads east." 1470 LET we=3150: LET no=1500: LET ea=1400 1480 RETURN 1500 LET l$="You are in an old churchyard. The church doors are open to thenorth, there is a gate to the south and a path to the east." 1520 LET no=2950: LET ea=1400: LET so=1450 1530 RETURN 1550 LET l$="Phew ! You are about one third of the way up the large green beanstalk. Below you can see your house and the surrounding countryside. What a pity you don't have a camera !" 1570 LET no=3100: LET so=no: LET ea=so: LET we=ea: LET up=1600: LET do=1050 1580 RETURN 1600 LET l$="You are now about two thirds of the way up. The view is realy spectacular. That new fisheye lens would be great for this." 1620 LET no=3100: LET so=no: LET we=so: LET ea=we: LET up=1650: LET do=1550 1630 RETURN 1650 LET l$="You are now at the top of the beanstalk, in a wild, bare country. Not a tree or blade of grass can be seen. A long road leads north." 1670 LET no=1700: IF l(7)+l(14)=-2 THEN LET do=1600 1680 RETURN 1700 LET l$="The long road winds its way across the barren wasteland." 1705 IF NOT l(21) THEN LET l(21)=1: LET l$=l$+" There is an old lady here. She says, 'Good morning, Jack. You are now in a country belonging to a wicked GIANT. His taste in food could be your downfall.'" 1720 LET no=1800: LET we=1650: LET ea=1750 1730 RETURN 1750 LET l$="You are still on the road. There is not much change to the countryside so I won'nt bother describing it again, except to say that there is a castle away to the north." 1770 LET no=1800: LET we=1700 1780 RETURN 1800 LET l$="You are lost in a maze with paths leading everywhere." 1810 LET h$="1 5.45 10 ??" 1812 IF a$="n" AND (l(22)=0 OR l(22)=2) THEN LET l(22)=2: GO TO 1820 1814 IF a$="e" AND l(22)=2 THEN LET l(22)=3: GO TO 1820 1816 IF a$="w" AND l(22)=3 THEN LET l(22)=4: GO TO 1820 1818 IF a$="s" AND l(22)=4 THEN LET l(22)=0: LET set=1850: GO TO set 1819 LET l(22)=0 1820 LET no=1800: LET so=no: LET ea=no: LET we=no 1830 RETURN 1850 LET l$="You have arrived at the castle door. A path leads round the castle to the east." 1870 LET we=1750: LET ea=1900 1880 RETURN 1900 LET l$="You are now faced with the east wall of the castle. There are no obvious entrances. The path continues north." 1920 LET no=1950: LET so=1850: LET we=1850 1930 RETURN 1950 LET l$="The back of the castle looks much the same as the east wall. There does not seem to be a tradesman's entrance. The path continues westwards and there isanother going north." 1970 LET no=2600: LET we=1800: LET ea=1900 1980 RETURN 2000 LET l$="You are in the entrance hall. There are four doors leading north, south, east and west." 2020 LET so=1850: LET ea=2050: LET we=2500: LET no=2350 2030 RETURN 2050 LET l$="The Library. This is a large and very impressive room which is full of books. There is a red 'phone on a small table in the corner." 2070 LET we=2000 2080 RETURN 2100 LET l$="The Kitchen. This is a fairly large room again. Indeed the furniture could be said to be GIANT ! There is a cupboard to the east and stairs lead down." 2115 IF l(24) THEN LET ea=2200 2120 LET no=2250: LET do=2150 2130 RETURN 2150 LET l$="There is a distinct smell of Bordeaux white circa 1967." 2170 LET l(25)=0: LET up=2100 2180 RETURN 2200 LET l$="The Cupboard. There are shelvesall round the walls but you are too small to reach them. There is only one exit." 2220 LET we=2100 2230 RETURN 2250 LET l$="The Dining Room. The table in here is of epic proportions. Doors lead west and south and tothe east is a sign." 2270 LET we=2300: LET so=2100: LET ea=1950 2280 RETURN 2300 LET l$="The Lounge. large easy chairs are the main feature of this hugh room. Doors lead west, south, and east." 2305 IF l(3) THEN LET l$=l$+" There's a GIANTsleeping in one of the chairs. Ssshh !" 2320 LET we=2550: LET ea=2250: LET so=2350 2330 RETURN 2350 LET l$="The Music Room. There is a large portrait of Beethoven on the wall and the last movement of his ninth symphony is coming from the immense Hi-Fi in the corner. Doors lead north, west and south." 2370 LET we=2450: LET so=2000: LET no=2300 2380 RETURN 2400 LET l$="The Secret Passage." 2420 LET l(25)=0: LET up=2500 2430 RETURN 2450 LET l$="The Store Room. There is a large safe in the corner. Thereseems to be a passage leading downwards as well as the door tothe east." 2470 LET do=2400: LET ea=2350 2480 RETURN 2500 LET l$="The Billiard Room. Several cuesare strewn about the floor. A large red ball the size of a football is lying up against thebiggest snooker table you have ever seen. There's a scoreboardon the wall. The door leads east." 2520 LET ea=2000 2530 RETURN 2550 LET l$="The Television Room. The 45"" t.v. set is on. The programme is 'Blue Peter' and Simon Groomehas forgotten the script as usual. He appears to be showinghow to make your own secret passage out of yogurt cartons and sticky-back plastic." 2570 LET ea=2300 2580 RETURN 2600 LET l$="You are on the first tee of a huge golf course. A sign stuck in the ground says 'Hole 1, 7345 yds, Par 3'. Some way off to the north you can see a flag.The castle is to the south." 2620 LET no=2650: LET so=1950 2630 RETURN 2650 LET l$="You are now half way down the fairway. The flag blows gently in the breeze, but is still someway off." 2670 LET no=2700: LET so=2600 2680 RETURN 2700 LET l$="You are now on the green. The flag towers above you, and the hole is at least 6 feet across. There is a bunker to the east, and a stream to the north." 2720 LET ea=2750: LET so=2650: LET no=3150 2730 RETURN 2750 LET l$="You are now in the bunker. This would be a tricky shot if you were really playing golf." 2770 LET we=2700: LET so=2650 2780 RETURN 2800 LET l$="You are in the garden shed. The garden is to the west and a dusty track climbs the hill to the south." 2820 LET we=1400: LET so=1350 2830 RETURN 2850 LET l$="You are standing in a quarry. There are huge slabs of stone all around." 2870 LET so=1100: LET ea=2900: LET up=ea 2880 RETURN 2900 LET l$="You are on a cliff top. Down below you can see the quarry andto the south some trees." 2920 LET do=2850: LET so=1150 2930 RETURN 2950 LET l$="Inside the church. Someone is playing music on the organ. Youare facing the main door to the south with a small side door to your left." 2970 LET so=1500: LET ea=1050 2980 RETURN 3000 IF b$="" THEN PRINT a$;" what ??": GO TO 100 3002 IF l(25)=0 THEN PRINT "It's too dark to ";a$;" anything.": GO TO 100 3003 IF i>=5 THEN PRINT "You can't carry any more !": GO TO 100 3005 LET found=0: FOR n=1 TO max: IF m$(n)=(b$+" ")( TO 7) AND l(n)=set THEN LET found=n: GO SUB 3040 3006 NEXT n 3009 IF found THEN GO TO 100 3010 FOR n=1 TO max: IF o$(n)=(b$+" ")( TO 14) AND l(n)=set THEN LET found=n: GO SUB 3040 3012 NEXT n 3020 IF NOT found THEN PRINT "That's not possible !": GO TO 100 3030 GO TO 100 3040 IF found>=3 AND found<=5 THEN IF NOT l(3)*l(4)*l(5) THEN PRINT "You can only carry one treasure at a time.": RETURN 3045 IF found=3 THEN PRINT "The harp cries 'Master! Master!'You hear sounds of movement nextdoor." 3050 PRINT "OK..": LET l(found)=0: LET i=i+1: RETURN 3100 PRINT "There is a loud scream as you fall to your death, narrowly missing your house.": FOR n=60 TO 0 STEP -2: BEEP .01,n: NEXT n: GO TO 9000 3150 PRINT "Gurgle..gurgle..gurgle...... You have fallen in the water anddrowned.": FOR n=60 TO 0 STEP -2: BEEP .01,n: NEXT n: GO TO 9000 3200 IF b$="" THEN PRINT "Unlock what ??": GO TO 100 3203 IF b$="safe" THEN GO TO 3350 3205 IF b$<>"door" AND b$<>"castle door" THEN PRINT "It doesn't have a keyhole !": GO TO 100 3210 IF set<>1850 THEN PRINT "There is no door to unlock.": GO TO 100 3215 IF l(23) THEN PRINT "It's already unlocked, silly !": GO TO 100 3220 IF l(11) THEN PRINT "You do not have the key.": GO TO 100 3225 IF l(14)=-1 THEN PRINT "You can't quite manage to get the key into the lock.": GO TO 100 3230 IF NOT l(17) THEN PRINT "The key is jamming the lock.": GO TO 100 3240 PRINT "Clunk !": LET l(23)=1: GO TO 100 3300 BEEP .01,10: INPUT "Combination please:"; LINE a$: IF a$="" OR LEN a$>10 THEN GO TO 3303 3305 PAUSE 50: FOR n=1 TO LEN a$: PRINT a$(n);: IF a$(n)<"0" OR a$(n)>"9" THEN PRINT AT 20,7;"That's not a number !": GO TO 3390 3307 FOR m=1 TO VAL a$(n): BEEP .01,0: PAUSE 10: NEXT m: PAUSE 50: NEXT n 3310 IF a$="3725" THEN PRINT AT 20,7;"Click.": PAUSE 100: LET l(27)=1: GO TO 3390 3315 IF a$="4234" OR a$="7345" THEN PRINT AT 20,7; PAPER 2;"Boom!!": FOR n=60 TO 0 STEP -5: BEEP .01,n: BORDER n/10: INPUT " ": PRINT PAPER n/10;p$: NEXT n: INPUT " ": FOR n=1 TO 150: NEXT n: CLS : PRINT "The safe blows up in your face. This has unfortunately caused you to met your maker.": GO TO 9000 3320 PRINT " IS WRONG !!!": GO TO 3390 3350 IF set<>2450 THEN PRINT "There is no safe here.": GO TO 100 3352 CLS : BORDER 1: DRAW 255,0: DRAW 0,175: DRAW -255,0: DRAW 0,-175: INPUT " " 3355 PLOT 55,47: DRAW 65,0: DRAW 0,81: DRAW -65,0: DRAW 0,-81: PLOT 120,47: DRAW 8,8: DRAW 0,81: DRAW -65,0: DRAW -8,-8: PLOT 120,128: DRAW 8,8 3360 LET p$=CHR$ 21+CHR$ 1: FOR n=6 TO 15: LET p$=p$+CHR$ 22+CHR$ n+CHR$ 7+" ": NEXT n 3365 PRINT AT 11,9; INK 0;CHR$ 140;CHR$ 140: CIRCLE INK 0;96,104,4: CIRCLE INK 0;96,104,7 3370 PRINT PAPER 0; INK 7;p$ 3375 PRINT AT 18,7; 3380 GO TO 3300 3390 PAUSE 100: BORDER 0: CLS : INPUT " ": GO TO 20 3400 IF b$="" THEN PRINT "Examine what ??": GO TO 100 3405 IF l(25)=0 THEN PRINT "There's not enough light.": GO TO 100 3410 LET found=0: FOR n=1 TO max: IF m$(n)=(b$+" ")( TO 7) AND (l(n)=set OR l(n)=0) THEN LET found=1: PRINT "You see.."'d$(n) 3415 NEXT n: IF found THEN GO TO 100 3420 FOR n=1 TO 10: IF e$(n)=(b$+" ")( TO 10) AND e(n)=set THEN LET found=1:: PRINT "You see.."'d$(n+16) 3425 NEXT n: IF found THEN GO TO 100 3430 FOR n=1 TO max: IF o$(n)=(b$+" ")( TO 14) AND (l(n)=set OR l(n)=0) THEN LET found=1: PRINT "You see.."'d$(n) 3440 PRINT "You see nothing interesting.": GO TO 100 3535 NEXT n: IF found THEN GO TO 100 3600 LET found=0: FOR n=1 TO max: IF l(n)<>0 THEN NEXT n: GO TO 3640 3610 IF NOT found THEN PRINT "You have the following..": PRINT : LET found=1 3620 GO SUB 700 3630 NEXT n 3640 IF NOT found THEN PRINT "You don't have anything !" 3650 RETURN 3800 IF b$="" THEN PRINT "Open what ??": GO TO 100 3802 IF b$="safe" OR b$="safe door" THEN GO TO 3900 3805 IF b$<>"door" AND b$<>"castle door" THEN PRINT "That would be a great feat !": GO TO 100 3810 IF set<>1850 THEN PRINT "There is no door to open.": GO TO 100 3820 IF NOT l(23) THEN PRINT "It 's locked !!": GO TO 100 3830 PRINT "Creak ! The door swings open.": LET no=2000: GO TO 100 3900 IF set<>2450 THEN PRINT "There ain't no safe here, man !": GO TO 100 3910 IF NOT l(27) THEN PRINT "It won't open.": GO TO 100 3920 IF l(27)=2 THEN PRINT "It's already open.": GO TO 100 3930 LET l(27)=2: LET l(15)=2450: PRINT "You open the safe door.": GO TO 100 4000 IF b$="" THEN PRINT a$;" what ??": GO TO 100 4010 LET found=0: IF b$="gloves" THEN LET found=14 4020 IF b$="boots" THEN LET found=7 4030 IF NOT found THEN PRINT "Don't be silly !": GO TO 100 4040 IF l(found)=0 THEN LET i=i-1: LET l(found)=-1: PRINT "OK..": GO TO 4070 4050 IF l(found)=set THEN LET l(found)=-1: PRINT "OK..": GO TO 4070 4060 PRINT "I see no ";b$;" !": GO TO 100 4070 IF set=1050 AND l(7)+l(14)=-2 THEN LET up=1550: GO TO 100 4080 IF set=1650 AND l(7)+l(14)=-2 THEN LET do=1600: GO TO 100 4090 GO TO 100 4100 IF b$="" THEN PRINT a$;" what ??": GO TO 100 4110 LET found=0: IF b$="gloves" THEN LET found=14 4120 IF b$="boots" THEN LET found=7 4130 IF NOT found THEN PRINT "Are you nuts ?": GO TO 100 4140 IF set=1600 OR set=1550 THEN GO TO 3100 4150 IF l(found)=-1 THEN LET l(found)=set: PRINT "OK.." 4160 IF NOT found THEN GO TO 499 4170 IF up=1550 THEN LET up=0 4180 IF do=1600 THEN LET do=0 4190 GO TO 100 4200 IF b$="" THEN PRINT "Oil what ??": GO TO 100 4210 IF b$<>"key" AND b$<>"rusty key" THEN PRINT "Why ?": GO TO 100 4215 IF l(11) THEN PRINT "You do not have the key !": GO TO 100 4220 IF set<>1100 THEN PRINT "I can see no lubricants.": GO TO 100 4230 PRINT "OK..": LET l(17)=1: LET o$(11)="shiny key": LET d$(11)=" a nice, gleaming mortice key." 4235 FOR n=1 TO 4: LET c(11,n)=5: NEXT n 4240 GO TO 100 4300 IF b$<>"" AND b$<>"sand" AND b$<>"in sand" THEN PRINT "You must be joking !": GO TO 100 4310 IF l(16) THEN PRINT "You have no digging implement.": GO TO 100 4320 IF set<>2750 THEN PRINT "There is nothing to dig.": GO TO 100 4325 IF l(9)<>9999 THEN PRINT "You are too hungry to dig !": GO TO 100 4330 PRINT "Scrape..scrape.. A hole appears in the sand.": LET l(4)=set: GO TO 100 4400 IF b$="" THEN PRINT "Tie what ??": GO TO 100 4410 IF b$<>"rope to cow" THEN PRINT "This is not possible !": GO TO 100 4420 IF set<>1050 THEN PRINT "What cow ?": GO TO 100 4435 IF l(6) THEN PRINT "You have no rope !" 4440 LET l(20)=1: PRINT "Mooo !! The cow is now tied by the neck.": GO TO 100 4500 IF b$="" THEN PRINT a$;" what ??": GO TO 100 4505 LET found=0: FOR n=1 TO max: IF m$(n)=(b$+" ")( TO 7) AND l(n)=0 THEN PRINT "OK..": LET found=1: LET l(n)=set: LET i=i-1 4506 NEXT n 4507 IF found THEN GO TO 100 4510 FOR n=1 TO max: IF o$(n)=(b$+" ")( TO 14) AND l(n)=0 THEN PRINT "OK..": LET found=1: LET l(n)=set: LET i=i-1 4515 NEXT n 4520 IF NOT found THEN PRINT "You don't have ";b$;" !" 4530 GO TO 100 5000 IF b$="" THEN PRINT a$;" what ??": GO TO 100 5010 IF b$<>"door" AND b$<>"cupboard door" THEN PRINT "I don't think taht would be a good idea !": GO TO 100 5020 IF set=1850 OR set=1000 OR set=1050 OR set=1400 THEN PRINT "The door is too strong.": GO TO 100 5030 IF set<>2100 THEN PRINT "You see no door here.": GO TO 100 5040 IF l(13) THEN PRINT "You've nothing to smash it with!": GO TO 100 5045 IF NOT l(28) THEN PRINT "You'll need some refreshment !": GO TO 100 5050 LET l(24)=1: LET ea=2200 5055 PRINT "Crunch !! The remains of the cupboard door fall away to the side." 5060 GO TO 100 5400 IF b$="" THEN PRINT a$;" what ?": GO TO 100 5410 IF b$<>"match" THEN PRINT "Be reasonable !": GO TO 100 5420 IF l(12) THEN PRINT "What match ??": GO TO 100 5430 IF l(25)=1 THEN PRINT "That was a waste !": GO TO 100 5440 LET l(25)=2: PRINT "That's better !": GO TO 100 5500 LET l(20)=2: LET e(4)=9999: LET l(2)=set: RETURN 5600 LET l(33)=e(4): LET l(34)=set: LET l(35)=i 5610 SAVE "Jack" DATA l() 5630 GO TO 100 5800 PRINT "Please wait..": GO SUB 7000 5805 PRINT "Start tape.." 5810 LOAD "Jack" DATA l(): LET e(4)=l(33): LET set=l(34): LET i=l(35) 5820 IF l(17) THEN FOR n=1 TO 4: LET c(11,n)=5: NEXT n: LET o$(11)="shiny key": LET d$(11)=" a nice, gleaming mortice key." 5840 GO TO 20 6000 IF b$="" THEN PRINT "Eat what ?": GO TO 100 6010 IF b$<>"food" THEN PRINT "That would not be very nice !": GO TO 100 6020 IF l(9)<>set AND l(9)<>0 THEN PRINT "There is no food.": GO TO 100 6030 PRINT "There are sounds of munching as you eat the food.": IF l(9)=0 THEN LET i=i-1 6035 LET l(9)=9999 6040 GO TO 100 6200 IF b$="" THEN PRINT a$;" what ??": GO TO 100 6202 IF l(25)=0 THEN PRINT "You can see nothing to ";a$: GO TO 100 6205 IF b$="water" THEN GO TO 6300 6210 IF b$<>"wine" AND b$<>"bottle of wine" THEN PRINT "That's impossible !!": GO TO 100 6220 IF l(10)<>set AND l(10)<>0 THEN PRINT "There is no wine.": GO TO 100 6230 LET l(28)=1: PRINT "You drink some wine.": GO TO 100 6300 IF set<>1450 AND set<>2700 THEN PRINT "This is a very dry area. In factit is so dry there is no water to drink.": GO TO 100 6310 PRINT "Due to a lack of pollution controls in this area, the waterwhich you have just drank was highly toxic. This has meant that you are now an Ex-Jack." 6320 FOR n=60 TO 1 STEP -1: BEEP .01,n: NEXT n: GO TO 9000 6400 IF l(18) THEN LET l(18)=0: LET l(19)=1: CLS : PRINT AT 11,15;"ZZZzzzzz !!": GO SUB 8200: PAUSE 200: BORDER 0: GO TO 20 6410 CLS : PRINT AT 10,10;"ZZZZZzzzzz !!": FOR n=1 TO 400: NEXT n 6420 GO TO 20 6600 FOR n=60 TO 0 STEP -1: BEEP .01,n: NEXT n 6610 PRINT "Due to your slow reactions the GIANT has caught you and bitten your head off. This has caused your bodily functions to cease.": GO TO 9060 6700 IF b$="" THEN PRINT "Chop what ??": GO TO 100 6710 IF b$<>"beanstalk" THEN PRINT "That would be a waste of time !": GO TO 100 6720 IF l(1) THEN PRINT "You do not have the axe !": GO TO 100 6730 IF set<>1050 OR NOT l(19) THEN PRINT "What beanstalk ?": GO TO 100 6740 GO TO 9000 7000 RESTORE 7400 7003 LET score=0 7005 LET max=16 7010 DIM l(35): DIM o$(max+1,14) 7020 DIM e$(10,10): DIM d$(26,46) 7030 DIM m$(max,7): DIM e(10) 7035 DIM c(max+1,4) 7037 FOR n=1 TO max+1: FOR m=1 TO 4: READ c(n,m): NEXT m: NEXT n 7040 FOR n=1 TO max: READ l(n),o$(n),m$(n),d$(n): NEXT n 7050 FOR n=1 TO 10: READ e(n),e$(n),d$(n+16): NEXT n 7060 RETURN 7400 DATA 5,6,6,6 7405 DATA 6,3,4,4 7410 DATA 6,6,6,6 7415 DATA 4,4,4,4 7420 DATA 7,7,7,7 7425 DATA 6,6,6,6 7430 DATA 7,7,7,7 7435 DATA 5,5,5,5 7440 DATA 6,4,6,6 7445 DATA 4,4,4,4 7450 DATA 3,3,3,3 7455 DATA 5,6,5,6 7460 DATA 5,5,6,5 7465 DATA 6,6,6,6 7470 DATA 6,6,6,6 7475 DATA 6,6,5,5 7480 DATA 0,0,0,0 7500 DATA 2800,"axe","axe"," an axe with a wooden handle" 7501 DATA 9999,"magic beans","beans"," some multi-coloured magic beans" 7502 DATA 2350,"golden harp","harp"," a magic golden harp" 7503 DATA 9999,"money bag","bag"," a cloth bag full of gold coins" 7504 DATA 2200,"magic goose","goose"," a magic goose that lays golden eggs" 7505 DATA 1300,"coil of rope","rope"," a coil of brown rope" 7506 DATA 1000,"climbing boots","boots"," a pair of Doc Martins !!" 7507 DATA 2050,"library book","book"," an old book with parchment pages" 7508 DATA 2100,"some food","food"," an apple and a banana" 7509 DATA 2150,"bottle of wine","wine"," une bouttelle de Bordeaux Blanc 1967" 7510 DATA 2950,"rusty key","key"," an old rusty key" 7511 DATA 2750,"box of matches","matches"," a box of Swan Vestas" 7512 DATA 2400,"sledge hammer","hammer"," a rather fine Stanley sledge hammer" 7513 DATA 1200,"leather gloves","gloves"," a pair of leather gloves" 7514 DATA 9999,"old parchment","parchment"," that it says 'tricky shot'" 7515 DATA 2850,"spade","spade"," a spade with a metal handle" 7520 DATA 2450,"safe"," a safe with a combination lock" 7521 DATA 2500,"scoreboard"," a scoreboard with score 37 25 on it" 7522 DATA 2050,"phone"," a GPO 'phone number 4234" 7523 DATA 1050,"cow"," a pretty black and white cow" 7524 DATA 1450,"waterfall"," a waterfall with pretty rainbow" 7525 DATA 1100,"oil"," a pool of Castrol GTX" 7526 DATA 1050,"beanstalk"," a hugh green plant climbing high" 7527 DATA 1850,"door"," a HUGE wooden door with mortice lock" 7528 DATA 2550,"television"," a Decca 45"" goggle-box" 7529 DATA 2250,"sign"," a sign saying EMERGENCY EXIT'" 8000 CLS : RANDOMIZE : GO SUB 8200: PRINT AT 5,15;"JACK";AT 7,15;"and the";AT 9,15;"BEANSTALK";AT 18,15;"* 1984" 8015 GO SUB 7000 8020 PRINT AT 20,1; PAPER 4; INK 0;" Press any key to continue": PAUSE 0 8030 CLS : DRAW 255,0: DRAW 0,175: DRAW -255,0: DRAW 0,-175 8040 PRINT OVER 1'''" JACK and the BEANSTALK ______________________"'''" In this adventure you play the part of Jack. Your aim is to steal the three treasures from the evil GIANT. They are.." 8050 PRINT OVER 1'" 1. The magic goose."'" 2. The golden harp."'" 3. The bag of gold coins."'''" Good Luck !!" 8090 PRINT AT 20,1;" Press any key to start": PAUSE 0: BORDER 1: INPUT " " 8095 FOR n=0 TO -10 STEP -1: BEEP 0.05,n: NEXT n 8100 RETURN 8200 BORDER 0: INPUT " " 8210 PRINT AT 20,1; PAPER 4;" a " 8212 PLOT 0,0: DRAW 255,0: DRAW 0,175: DRAW -255,0: DRAW 0,-175 8215 LET x=70 8220 FOR n=16 TO 160 STEP 2 8225 LET rnd=RND 8230 LET x=x+(rnd>.5)-(rnd<.5)+(x<=0) 8232 IF rnd>.95 THEN IF n>16 THEN DRAW INK 4;20-n/16,3-RND*6 8233 IF RND>.95 THEN PLOT INK 4;x,n: DRAW INK 4;-20+n/16,3-RND*6 8235 IF INKEY$=CHR$ 13 THEN BEEP .01,0: RETURN 8240 PLOT INK 4;x,n: DRAW INK 4;(175-n)/10,0 8245 BEEP .0025,n/6 8250 NEXT n 8260 RETURN 9010 FOR n=3 TO 5: IF l(n)<1550 THEN LET score=score+1 9020 NEXT n 9023 PRINT 9025 IF score=0 THEN PRINT "You have failed miserably. Due to you not being able to get onepiece of treasure back, your mother is sure to starve.": GO TO 9063 9030 IF score=1 THEN PRINT "You have not done too well. Onlyone of the treasures will not last very long. Especially with inflation at 300%.": GO TO 9063 9040 IF score=2 THEN PRINT "Two out of three ain't bad. Mum won't starve, but she won't be all that rich either.": GO TO 9063 9050 IF score=3 THEN PRINT "Congratulations. You've managed to collect all the treasures. You live happily ever after." 9059 GO TO 9063 9060 GO TO 9010 9063 BEEP 0.01,10: INPUT "Another game ? "; LINE a$ 9065 IF a$="" THEN LET a$="Y" 9070 IF a$(1)="y" OR a$(1)="[" THEN GO TO 0 9080 STOP 9990 REM Tape 9991 SAVE "Jack" LINE 9999 9992 SAVE "Jack.udg"CODE 60000,512 9993 STOP : REM PRINT "Verify": VERIFY "": VERIFY ""CODE : STOP 9995 REM MICRODRIVE 9996 REM CLEAR : ERASE "m";1;"Jack": SAVE *"m";1;"Jack" LINE 9998 9997 REM VERIFY *"m";1;"Jack": STOP 9998 REM CLEAR 59999: LOAD *"m";1;"Jack.udg"CODE : RUN 9999 CLEAR 59999: LOAD ""CODE : RUN 1 REM *********************** 2 REM * JACK and the * 3 REM * BEANSTALK * 4 REM * Your Computer * 5 REM * July 1984 * 6 REM * entered: F. Chrysler* 7 REM * written by * 8 REM * Carruthers & Sellars* 9 REM *********************** 10 LET a$="": LET i=0: LET set=1000: LET pre=0: LET keys=0 15 POKE 23609,10: BORDER 0: PAPER 1: INK 7: GO SUB 8000 20 LET l(25)=1: LET h$="You're doing fine, Jack.": LET no=0: LET we=no: LET ea=no: LET so=no: LET up=no: LET do=no 30 GO SUB set 35 IF l(20)=1 THEN LET e(4)=set 40 CLS : PRINT 'l$ 42 IF NOT l(3) THEN LET s$="ff(ee) ff(ii) ff(eau) ffum (ii)smel(th)(ee)bluud of an ingli(sh)man": PRINT '"A thundering voice just behind you says...."''" Fee Fi Fo Fum,"'" I smell the blood"'" of an Englishman." 45 IF e(4)=set THEN IF set<>1250 THEN PRINT "Daisybell the cow is here." 50 IF l(20)=2 THEN LET l(20)=0: PRINT "A strange man wearing a white hat and a butcher's apron says 'Aha !! Just what I need.' He takes 'Daisybell' and before youcan do anything he disappears, leaving some beans on the path." 55 IF NOT l(25) THEN PRINT "It's too dark to see anything.": GO TO 100 57 IF l(25)=2 THEN LET l(25)=0 60 LET found=0: FOR n=1 TO max: IF l(n)<>set THEN NEXT n: GO TO 90 63 IF NOT found THEN PRINT : PRINT "You can see..": PRINT : LET found=1 65 GO SUB 700 70 NEXT n 75 GO SUB 700 80 GO TO 100 90 IF (a$="look" OR a$="l") AND NOT found THEN PRINT "You can't see anything special" 100 BEEP .01,10: GO SUB 600: IF i$="" THEN GO TO 100 102 FOR n=1 TO LEN i$: IF i$(n)<="A" AND i$(n)>="z" THEN LET i$(n)=CHR$ (CODE i$(n)+32) 103 NEXT n 105 GO SUB 500 107 IF pre=set THEN GO TO 6600 109 IF NOT l(3) THEN LET pre=set 110 IF a$="go" THEN LET a$=b$: LET b$="" 115 IF (a$="n" OR a$="north") AND no THEN LET set=no: GO TO 20 120 IF (a$="s" OR a$="south") AND so THEN LET set=so: GO TO 20 130 IF (a$="w" OR a$="west") AND we THEN LET set=we: GO TO 20 140 IF (a$="e" OR a$="east") AND ea THEN LET set=ea: GO TO 20 150 IF (a$="d" OR a$="down" OR a$="descend") AND do THEN LET set=do: GO TO 20 155 IF (a$="u" OR a$="up" OR a$="climb") AND up THEN LET set=up: GO TO 20 160 IF a$="recap" OR a$="r" THEN GO TO 40 170 IF a$="help" OR a$="h" THEN PRINT h$: GO TO 100 180 IF a$="take" OR a$="get" THEN GO TO 3000 190 IF a$="put" OR a$="drop" THEN GO TO 4500 210 IF a$="look" OR a$="l" THEN GO TO 55 220 IF a$="examine" OR a$="ex" OR a$="read" THEN GO TO 3400 230 IF a$="save" THEN GO TO 5600 240 IF a$="load" THEN GO TO 5800 250 IF a$="inventory" OR a$="i" THEN GO SUB 3600: GO TO 100 260 IF a$="sleep" THEN GO TO 6400 270 IF a$="tie" THEN GO TO 4400 280 IF a$="wear" THEN GO TO 4000 290 IF a$="quit" THEN GO TO 9000 300 IF a$="remove" THEN GO TO 4100 310 IF a$="oil" OR a$="lubricate" THEN GO TO 4200 320 IF a$="unlock" THEN GO TO 3200 330 IF a$="open" THEN GO TO 3800 340 IF a$="dig" THEN GO TO 4300 350 IF a$="eat" THEN GO TO 6000 360 IF a$="light" OR a$="strike" THEN GO TO 5400 370 IF a$="smash" OR a$="break" THEN GO TO 5000 380 IF a$="drink" THEN GO TO 6200 390 IF a$="chop" THEN GO TO 6700 490 IF LEN a$=1 THEN PRINT "You can't !": GO TO 100 499 PRINT "You can't ";a$;" ";b$;" !": GO TO 100 500 IF i$(1)=" " AND LEN i$>1 THEN LET i$=i$(2 TO ): GO TO 500 502 LET sp=0: LET a$="": LET b$="": FOR n=1 TO LEN i$ 505 IF i$(n)=" " AND NOT sp THEN LET sp=1: GO TO 520 510 IF NOT sp THEN LET a$=a$+i$(n) 515 IF sp THEN LET b$=b$+i$(n) 520 NEXT n 530 RETURN 600 POKE 23692,255: LET i$="" 610 LET xat=25-PEEK 23689 612 IF xat>21 THEN LET xat=21: PRINT : PRINT 615 PRINT INK 6;AT xat,0;")";i$;"_"; 620 PAUSE 0 625 LET a$=INKEY$ 627 IF a$="" THEN GO TO 620 628 BEEP .004,34.4 630 IF CODE a$=13 THEN PRINT INK 6;AT xat,0;")";i$;" ": RETURN 635 IF CODE a$=12 AND i$<>"" THEN LET i$=i$( TO LEN i$-1): GO TO 615 645 IF (a$<"A" OR a$>"z") AND a$<>" " THEN GO TO 620 647 IF LEN i$>25 THEN BEEP .1,-10: GO TO 620 650 LET i$=i$+a$: GO TO 615 700 LET addr=60000+(n-1)*32 710 POKE 23675,addr-256*INT (addr/256) 720 POKE 23676,INT (addr/256) 725 POKE 23692,255 730 PRINT " "; INK c(n,1);CHR$ 144; INK c(n,2);CHR$ 145 740 PRINT " "; INK c(n,3);CHR$ 146; INK c(n,4);CHR$ 147; INK 7;" ";o$(n) 745 PRINT 750 RETURN 1000 LET l$="You are inside a small, barely furnished room. To the south is a door leading into the garden and to the north is the front door." 1003 IF l(26) AND l(2) THEN LET l$=l$+" Your Mother is asleep in the corner." 1005 IF NOT l(26) THEN LET l$=l$+" Your poor Mother says 'Take our cow to the market and sell her, Jack.'": LET l(26)=1 1007 IF l(26) AND NOT l(2) THEN LET i=i-1: LET l$=l$+" Your Mother is very,very angry. She says 'You bad, stupidboy. Now we shall starve.' In her anger she throws the beans out of the window.": LET l(2)=9999: LET l(18)=1 1020 LET no=1050: LET so=1400 1030 RETURN 1050 LET l$="You are just outside the cottage. A dusty path leads to the east and a sign pointing west says 'To The Church.'" 1055 IF l(19) THEN LET h$="Going up ?": LET l$=l$+CHR$ 13+"There is a large green beanstalkrising up into the clouds !": IF l(7)+l(14)=-2 THEN LET up=1550 1060 LET we=2950: LET ea=1100: LET so=1000 1070 RETURN 1100 LET l$="You are on a dusty road leading east to west with an opening to the north. There is a pool of oil on the ground." 1120 LET we=1050: LET ea=1150: LET no=2850 1130 RETURN 1150 LET l$="You are in some woods. The dusty road continues east to west, there is a clearing to thenorth and a small hill to the south." 1155 IF l(20) AND RND>.75 THEN GO SUB 5500 1170 LET no=2900: LET we=1100: LET so=1350: LET ea=1200 1180 RETURN 1200 LET l$="More woods. The dusty track nowruns north and south. Sounds (and smells) of farm animals drift from the south. A sign tothe east says 'No Fishing'." ```