Commodore 64 User Manual page 155

Hide thumbs Also See for 64:
Table of Contents

Advertisement

100 print"Ojotto jim butterfield"
120 input"Owant instructions";z$:ifasc(zf)=78goto250
130 print"Otry to guess the mystery 5-letter word"
140 print"Oyou must guess only legal 5-letter"
150 print"words, too...
160 print"you will be told the number of matches"
170 print"(or 'jots') of your guess."
180 print"Ohint: the trick is to vary slightly"
190 print " from one guess to the next; so that"
200 print" if you guess 'batch' and get 2 jots"
210 print" you might try 'botch' or 'chart"'
220 print" for the next guess..."
250 data bxbsf,ipccz,dbdif,esfbe,pggbm
260 data hpshf,ibudi,d,jwjm,kprnmz,lbzbl
270 data sbkbi,mfwfm,njnjd,boofy,gjgfs
280 data rvftu,s.jwfs,gsftt,puufs,fwfou
290 data xfbwf,fyupm,nvtiz,afcsb,gjaaz
300 data ui,jdl.esvol,gmppe,ujhfs,gblfs
310 data cppui,mzjoh,trvbu,hbvaf,pxjoh
320 data uisff,tjhiu.bymft,hsvnq,bsfob
330 data rvbsu,dsffq,cfmdi,gsftt,tgbsl
340 data sbebs , svsbm,tnfmm , gsp>:o,es,jgu
400 n=50
410 dim n$(n),z(5),y(5)
420 for j=lton:readnf(j):nextj
430 t=ti
440 t=t/1000:ift=lthengoto440
450 z=rnd(-t)
500 g =0:n$=nS (rnd(1)*n+1)
510 print "Oi have a five letter word:":ifr;>0goto560
520 print "guess (with legal words)"
530 print "and i'll tell
you how many"
540 print "'jots',
or matching
letters,"
550 print "you have...
560 g=g+l:input "your word";z$
570 if len(z$)<%5thenprint "you must guess a
5-letter word!":goto560
580 v=O:h=O:rn=O
590 forj=lto5
600 z=asc(midf(z$,j,1)):y=asc (midf(n$ ,j,1))-1:ify=64theny=90
610 ifz<65orz-90thenprint"that's not a word!":goto560
620 ifz=65orz=69orz=73orz=79orz=85orz=89thenv=v+1
630 ifz=ythenm=m+1
640 z(j)=z:y(j)=y:nextj
650 ifm=5goto800
660 ifv=0orv=5thenprint"come on-what kind of
a word is that?":goto560
670 for j=1to5:y=y(j)
680 for k=1to5:ify=z(k)thenh=h+l:z(k)=0:goto700
690 next k
700 next j
710 print" ODDDDDDDODDDDDDDDDDD ";H;"JOTS"
720 ifg<:30goto560
730 print"i'd_better tell
you.. word was
740 for,j=lto5:printchr$(y(,j));:nextj
750 print"'':goto810
800 print"you got it in only";g;"guesses."
810 input"Oenother word";zf
820 r=1:ifasc(z$)< 78gotoSOO
145

Hide quick links:

Advertisement

Table of Contents
loading

Related Products for Commodore 64

Table of Contents