Magazine: Ahoy! Issue No.: 54 Date: June 1988 Pages: 80-82 Transcribed by Patrick Kellum -------------------------- PROGRAMMING YOUR OWN TEXT GAMES FROM PAGE 39 10 rem lost dutchman's mine 20 rem by cleveland m. blakemore 30 rem runs on all commodore computers 40 rem with 40 columns and petascii 50 rem lock in uppercase & clear screen 60 printchr$(8)chr$(142)chr$(147) 70 rem print title screen 80 print"{down}{down}{down}{down}{down}{down}{down}"tab(10)"lost dutchman's mine" 90 printtab(10)"{down}{down}* all c= computers *":printtab(14)"{down}(c)1988 cmb" 100 printtab(8)"{down}{down}by cleveland m. blakemore" 110 rem initialize arrays and variables 120 dim v$(32),n$(20),l$(9),s$(9),d(9,6),o(9,8),i(8),d$(8),m$(4) 130 rem variables and flags 140 rem cl=current location 150 dim cl,wingame,weight,dead,alive,wolf,ghost,full,empty,river,mound,count 160 alive=1:dead=0:wolf=alive:spirit=alive 170 full=1:empty=0:river=empty:mound=full:count=0 180 rem read locations & descriptions 190 forx=.to9:readl$(x):next:forx=.to9:reads$(x):next 200 rem read in directions 210 forx=1to9:ford=1to6:readd(x,d):nextd,x 220 forx=1to32:readv$(x):next:forx=1to20:readn$(x):next 230 forx=.to8:readd$(x):next 240 readx,d:ifx=-1then260 250 o(x,d)=1:goto240 260 forx=.to4:readm$(x):next 270 rem wait for return key press 280 printtab(8)"{down}{down}{down}{down}{down}{down}press return to continue" 290 geta$:on-(a$<>chr$(13))goto290 300 rem start off at gas station 310 cl=.:gosub730 320 rem parser main routines 330 rem get command 340 in$="":v=.:n=. 350 input"{down}command>";in$:ifin$=""thenprint"silence is golden.":goto350 360 rem parse verb 370 iflen(in$)>1then450 380 v=.:forx=1to7:ifin$=v$(x)thenv=x 390 next:ifv=.thenprint"what does that mean?":goto600 400 ifv=7thengosub880:goto600 410 on-(cl=6and(v=1orv=6)andweight>1)goto420:goto430 420 print"you are carrying too much to fit throughthe crack.":goto600 430 ifd(cl,v)thencl=d(cl,v):gosub730:goto600 440 print"you can't go that way!":goto600 450 v=.:forx=8to13:ifin$=v$(x)thenv=x 460 next:ifvthenv=v-7:goto410 470 v=.:forx=14to32:ifleft$(in$,len(v$(x)))=v$(x)thenv=x:d=len(v$(x)) 480 next:ifv=.thenprint"i don't know that verb!":goto600 490 rem parse noun 500 x=len(in$):ifx=dthen570 510 ifmid$(in$,d,1)<>chr$(32)andd0thenx=1:goto700 640 ifwolf=aliveandcl=7andcount>1thenx=2:goto700 650 ifspirit=aliveandcl=4andcount>4thenx=3:goto700 660 ifspirit=aliveandcl=4andcount>2thenprint"{down}the spirit looks real angry!" 670 if((cl>1andcl<4)orcl>5)andi(0)>-1andcount>2andrnd(0)>.5thenx=4:goto700 680 count=count+1 690 goto340 700 print:printm$(x):ifxthenprint"sorry, you have died..." 710 end 720 rem print location 730 count=0 740 printchr$(147); 750 if((cl>1andcl<4)orcl>5)andi(0)>-1thenprint"it's pitch dark in here!":return 760 print"you are":printl$(cl) 770 rem print available directions 780 print"directions:"; 790 d=.:forx=1to6:ifd(cl,x)thenprintv$(7+x);",";:d=x 800 next:ifd=.thenprint"none." 810 ifdthenprint"{left}." 820 rem print objects at location 830 print"you can now see:":ifs$(cl)>""thenprints$(cl) 840 d=.:forx=.to8:ifo(cl,x)thenprintd$(x):d=1 850 next:ifd=.ands$(cl)=""thenprint"nothing." 860 return 870 rem load/inventory 880 print"you are carrying:":d=.:forx=.to8:ifi(x)thenprintd$(x):d=1 890 next:ifd=.thenprint"nothing." 900 return 910 rem gozer 920 ifcl=.thencl=1:goto950 930 ifcl=1thencl=.:goto950 940 print"nothing happens here.":return 950 gosub730:return 960 rem take/get 970 ifn=.thenprint"get what?!?":return 980 ifn>9thenprint"you can't get that!":return 990 ifi(n-1)thenprint"you already have it!":return 1000 ifo(cl,n-1)theni(n-1)=o(cl,n-1):o(cl,n-1)=.:print"ok,taken.":goto1070 1010 print"it's not here!":return 1020 rem drop/put 1030 ifn>9thenprint"you must be confused.":return 1040 ifi(n-1)=.thenprint"you don't have it!":return 1050 o(cl,n-1)=i(n-1):i(n-1)=0:print"okay, dropped." 1060 ifo(0,5)ando(0,7)ando(0,8)thenwingame=1 1070 weight=0:forx=.to8:ifi(x)thenweight=weight+1 1080 next:return 1090 rem light 1100 ifi(1)=.thenprint"no matches.":return 1110 ifn<>1thenprint"you're a pyromaniac!":return 1120 ifi(.)=.thenprint"you don't have it!":return 1130 ifi(.)=-1thenprint"it's already burning.":return 1140 i(.)=-1:gosub730:print"{down}okay, it's burning.":return 1150 rem dig 1160 ifcl<>9orn<>15thenprint"try it somewhere else.":return 1170 ifmound=emptythenprint"the mound has already been excavated.":return 1180 o(9,8)=1:mound=empty:gosub730 1190 print"{down}okay, you have dug a deep hole...":return 1200 rem shoot/kill 1210 ifi(3)=.thenprint"you don't have the "n$(4)"ver.":return 1220 ifi(6)=.thenprint"you don't have the "n$(7)"ts.":return 1230 ifn<>13andn<>14thenprint"you're crazy.":return 1240 ifcl<>7thenprint"it's not here.":return 1250 wolf=dead:print"{down}the revolver thunders fire and the wolf falls over dead"; 1260 print"{right}in mid-leap.":s$(7)="a dead timber wolf":return 1270 rem say 1280 ifn=10then920 1290 print"nothing happens.":return 1300 rem turn/rotate/twist 1310 ifcl<>8orn<>18thenprint"interesting concept...":return 1320 river=full:print"the door blasts open with a tidal wave of water!!!" 1330 print"the river bed quickly fills up and you{right}{right}are drenched." 1340 print"you'd better leave. it's almost neck{right}{right}{right}{right}deep in here!" 1350 s$(8)="bubbles coming out of your clenched lipsunderwater":count=0:return 1360 rem blow/whist 1370 ifn=.thenprint"tweet tweet tweet..." 1380 ifcl=4andn=.thenprint"the spirit trembles and wavers a little.":return 1390 ifn<>5thenprint"that's ridiculous!":return 1400 ifi(n-1)=.thenprint"you don't have it!":return 1410 ifcl<>4thenprint"nothing happens.":return 1420 spirit=dead:print"the spirit writhes and vanishes in a{right}{right}{right}{right}cloud of smoke!" 1430 s$(4)="":return 1440 rem look/examine 1450 ifn=.thengosub740:return 1460 ifn<10thenifi(n-1)=.thenprint"you don't have it!":return 1470 ifn=2thenprint"gozer travel inc.'need to travel?? call gozer!!'":return 1480 ifcl=2andn=12thenprint"his bony claw points to the east...":return 1490 ifcl=0andn=19thenprint"{rvs on} put all the treasure on this shelf ":return 1500 ifn=1andi(0)=-1thenprint"it's burning.":return 1510 ifn=1andi(0)=1thenprint"it's out.":return 1520 print"you see nothing out of the ordinary.":return 1530 rem locations 1540 data in a deserted last chance gas station 1550 data"in a dusty adobe house with a sunbeam{right}{right}{right}coming through an east window" 1560 data in a long e-w mineshaft,in a sloping granite tunnel 1570 data in front of an old boarded up mineshaft entrance,in a deep ravine 1580 data inside a cool cavern with a small crack leadingdown to the north 1590 data on a spiral stone staircase 1600 data in a subterranean river bed running east & west 1610 data in an ancient indian burial ground 1620 rem specific observations 1630 data a metal plaque above a glass shelf,a skull mounted on a spear 1640 data a skeleton draped with cobwebs,"",a whistling evil spirit 1650 data "",a colossal stone sun calendar,a ravenous snarling timber wolf! 1660 data a circular wheel set in the middle of aniron door to the east 1670 data a large burial mound 1680 rem directions 1690 rem n,s,e,w,u,d 1700 data 4,0,0,0,0,0 1710 data 0,0,6,7,3,0 1720 data 0,0,0,0,4,2 1730 data 3,1,0,5,0,0 1740 data 0,0,4,0,0,0 1750 data 8,0,0,2,0,8 1760 data 0,0,2,0,2,9 1770 data 0,6,0,8,6,0 1780 data 0,0,0,0,7,0 1790 rem verbs 1800 data n,s,e,w,u,d,i,north,south,east,west,up,down,load,inven,gozer,take 1810 data get,drop,put,light,dig,shoot,kill,say,turn,rotat,twist,blow,whist 1820 data look,examine 1830 rem nouns 1840 data torch,match,shove,revol,bottl,diamo,bulle,ruby,nugge,gozer 1850 data skull,skele,wolf,timb,mound,calen,spiri,wheel,plaqu,shelf 1860 rem descriptions 1870 data a wooden torch,a matchbook,a rusty shovel 1880 data a pearl handled revolver,an empty 7-up bottle 1890 data a glowing diamond,a handful of rusty bullets,a lustrous red ruby 1900 data the dutchman's nugget 1910 rem objects & initial locations 1920 data 0,1,0,3,0,4,1,0,5,2,2,6,3,7,8,5,-1,-1 1930 rem end of game messages 1940 data congratulations! you've won the game! 1950 data you drowned in the river.,the timber wolf tears you to shreds. 1960 data the evil spirit sucked the breath out of you! 1970 data you fell down in the dark and broke your neck! EOF