home *** CD-ROM | disk | FTP | other *** search
/ Ahoy 1985 July / Ahoy_Magazine_85-07_1985_Double_L.d64 / brainframe (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  5KB  |  141 lines

  1. 10 dim r(5),rc(5),n(5),t(15),w$(15),w2$(15)
  2. 20 sc=1024:qa=198:qb=214:ww=54272:gu=0:gf=0:tt=0:ol=0
  3. 30 a$(1)="you win !!![146]":a$(2)="            "
  4. 40 a$(3)="                                   "
  5. 50 wf=54276:p1=54273:vl=54296:ad=54277:fq=1:cl=53280:ch=646
  6. 60 pokecl,3:pokech,7:poke53281,0:print"[147]"
  7. 70 rem
  8. 80 fort=1to500:f=1:f=0:next
  9. 90 fori=1to6:readh(i):readl(i):readd(i):next: rem * pitch values
  10. 100 fori=1to18:print"";spc(i);" [209]":fort=1to80:next:nexti
  11. 110 l(1)=225:l(2)=160:r(1)=97:r(2)=160:q=1163:pokeq,160
  12. 120 lf=q-1:rt=q+1:fori=1to10:forj=1to2:pokelf,l(j):pokert,r(j)
  13. 130 fort=1to60:next:nextj:lf=lf-1:rt=rt+1:nexti
  14. 140 fort=1to200:next:mm$="brainframe":q=lf+2
  15. 150 fori=1to10:m$=mid$(mm$,i,1):m=asc(m$):pokeq,m+128-64
  16. 160 fq=fq+10:gosub1220:q=q+2:fort=1to300:next:nexti
  17. 170 fort=1to400:fq=fq+10:gosub1220:print"[153]"
  18. 180 print"";tab(9);"an excercise in logic"
  19. 190 print"";tab(13);"for the c-64[157][157][157][157][157][157][157]by"
  20. 200 print"";tab(14);"norm vogel"
  21. 210 fort=1to425:f=1:f=0:f=t/33:next
  22. 220 print"";:gosub1260
  23. 230 print"[156] i will select a 3 to 5 - digit number   (your choice),";
  24. 240 print" composed of numbers from 0 - 9.[156]  (note: each number";
  25. 250 print" can be used  more than once).[156]  after entering your   try";
  26. 260 print" (you have 15), i will tell you how  many numbers are";
  27. 270 print" correct & in the cor-  rect position,";
  28. 280 print" [156]and how many are correct but in the wrong[156] position."
  29. 290 print" if you give up during the game, just    type in";
  30. 300 print" e[156], and i'll tell you what the   solution was and";
  31. 310 print" end the game.":printtab(13);"good luck!"
  32. 320 print" enter the size of the number (3/4/5)";
  33. 330 getnd$:ifnd$=""then330
  34. 340 ifasc(nd$)<51orasc(nd$)>53then330
  35. 350 nd=val(nd$):gosub1260
  36. 360 ifnd<>olthengf=0:tt=0:gu=0:fori=1to15:w$(i)=" ":w2$(i)=" ":next
  37. 370 print"[147]";tab(10);"";nd;" numbers[146]"
  38. 380 print"";tab(28);"no.   wrong"
  39. 390 print" try";tab(27);"[159]& pos   pos"
  40. 400 pokeqb,22:print:print" ([158]'r' to re-do line / [158]'e' to end game)"
  41. 410 tt=tt+1:tw=0:sp=10:p=9-nd:sp=10:ifnd=3thensp=12
  42. 420 fori=1tond:r(i)=int(rnd(0)*10):next:bc=7:bb=1
  43. 430 pokeqb,6:print:
  44. 440 rem
  45. 450 rem  *** start of D! D::  ***
  46. 460 tw=0:yg=0:forz=1to15:printa$(3)
  47. 470 print "[145][150]";z;:pokech,bc+bb:w=6
  48. 480 fori=1tond
  49. 490 getn$:ifn$=""then490
  50. 500 ifn$="e"thengosub1370:goto870
  51. 510 ifn$="r"thengosub1260:print:print"[145]";spc(3);a$(3):goto470
  52. 520 ifasc(n$)<48orasc(n$)>57then490
  53. 530 printtab(w);n$;:n(i)=val(n$):w=w+p:nexti
  54. 540 fori=1tond:rc(i)=r(i):fq=n(i)+25:gosub1220
  55. 550 poke53280,n(i)+1:forj=1to450:nextj:nexti
  56. 560 rem
  57. 570 rem  ***  corpos comparator:  ***
  58. 580 cp=0:fori=1tond:ifn(i)=rc(i)thencp=cp+1:n(i)=98:rc(i)=99
  59. 590 nexti:ifcp=nd-1thentw=tw+1
  60. 600 rem
  61. 610 rem  ***  cor comparator:  ***
  62. 620 co=0:fori=1tond:forj=1tond:ifn(i)=rc(j)thenco=co+1:n(i)=98:rc(j)=99
  63. 630 nextj:nexti
  64. 640 ifcp=ndthen740
  65. 650 rem  ***  in-game prompts:  ***
  66. 660 ifcp<>ndthen printtab(28);cp;"    ";co:bb=-bb
  67. 670 ifnd=3andz=10thenr=4:gosub1070
  68. 680 iftw=4thenr=2:gosub1070
  69. 690 ifcp+co=ndandyg=0thenr=1:gosub1070
  70. 700 ifz=14thenr=3:gosub1070
  71. 710 ifz=15thenr=5:gosub1070:goto940
  72. 720 nextz
  73. 730 rem  ***  win routine:  ***
  74. 740 f=2:g=1:pokecl,2:print"[147]";tab(5);a$(1);spc(7);z;" tries"
  75. 750 gosub1310:print"";tab(12);"[156]the answer was:"
  76. 760 printspc(sp);:fori=1tond:printr(i);spc(6-nd);:next:print
  77. 770 t(z)=t(z)+1:t$=str$(t(z)):w$(z)=mid$(t$,2,1):ift(z)<10then790
  78. 780 w2$(z)=right$(t$,1)
  79. 790 ifz>ndgoto820
  80. 800 print"[159]unbelieveable! 'giveups' reduced to '0'!":gu=0:gf=1
  81. 810 goto940
  82. 820 ifz<=nd+2thenprint"[159]next time, i'll have to give u a harder one!":goto940
  83. 830 ifz<nd+6thenprint"[159]  not bad, but u need more practice!":goto940
  84. 840 print"[159]you need alot more practice! try again!":goto940
  85. 850 rem
  86. 860 rem ***  giveup rD{$7f}ine:  ***
  87. 870 gu=gu+1:ifgf=1thengu=0
  88. 880 pokecl,2:print"[147]";tab(12);"the answer was:"
  89. 890 printspc(sp);:fori=1tond:printr(i);spc(6-nd);:next:print
  90. 900 print"[159] try again! you might get it next time!"
  91. 910 f=2:g=0
  92. 920 rem
  93. 930 rem  ***  stats:  ***
  94. 940 print:print"[154]tries:  1 2 3 4 5 6 7 8 9 0 1 2 3 4 5"
  95. 950 print"  won:[153]  ";:fori=1to15:printw$(i);" ";:next
  96. 960 print:printtab(8);:fori=1to15:printw2$(i);" ";:next
  97. 970 print:print"[150]    total games: ";tt;spc(3);"giveups:";gu
  98. 980 print"     do you want to try again?"
  99. 990 print"  ([158]y/n or [158]i to change # of digits)";
  100. 1000 getyn$:print"";tab(5);a$(f):f=f-g
  101. 1010 ifyn$="y"thenfq=150:gosub1220:goto370
  102. 1020 ifyn$="i"thenprint"[147]":gosub1260:ol=nd:goto230
  103. 1030 ifyn$<>"n"theng=-g:fort=1to400:next:goto1000
  104. 1040 print"[147]":end
  105. 1050 rem
  106. 1060 rem  *** in-game prompts:
  107. 1070 onrgoto1080,1100,1120,1130,1150
  108. 1080 fq=200:gosub1220:printtab(6);"[158]you've got 'em all now!"
  109. 1090 yg=1:goto1140
  110. 1100 gosub1370:printtab(8);"[158]going for broke, eh?":tw=99:goto1140
  111. 1120 fq=0:gosub1220:printtab(6);"[158]this is your last chance!":goto1140
  112. 1130 gosub1370:printtab(8);"[158]you haven't got it [159]yet?!"
  113. 1140 print"[145]";:fort=1to350:x=t/33:next:return
  114. 1150 gosub1370:print:print"     [158]good guess, but the answer was:    "
  115. 1160 printa$(3)
  116. 1170 print"[145][145]";spc(sp);:fori=1tond:printr(i);spc(6-nd);:next:print
  117. 1180 pokeqa,0:print"        [150]hit any key to continue [218]":waitqa,1
  118. 1190 print"[147]":gosub1260:f=2:g=0:pokeqa,0:return
  119. 1200 rem
  120. 1210 rem  ***  pitches:
  121. 1220 pokevl,14:pokewf,0:pokep1,fq+20:pokead,25:pokewf,17
  122. 1230 fort=1to100:next:pokewf,0:return
  123. 1240 rem
  124. 1250 rem  ***  sweep:
  125. 1260 fori=1to22:pokeww+i,0::nexti
  126. 1270 pokeww+24,12:pokeww+5,80:pokeww+6,243:pokeww+3,4::pokeww+4,129
  127. 1280 fori=0to140step4:pokeww+1,i:nexti:pokeww+4,128:fori=1to50:nexti
  128. 1290 pokeww+4,128:return
  129. 1300 rem ***  tune:
  130. 1310 fori=wwtoww+24:pokei,0:next
  131. 1320 pokevl,6:pokead,31:pokeww+3,200:pokeww+2,200:pokeww+6,89
  132. 1330 fori=1to6
  133. 1340 pokeww+1,h(i):pokeww,l(i):pokewf,65
  134. 1350 fort=1tod(i):next:pokewf,64:fort=1to10:next:nexti:return
  135. 1360 rem ***  razz:
  136. 1370 pokevl,15:pokead,45:pokead+1,165
  137. 1380 pokewf,33:pokewf-3,6:pokewf-4,5
  138. 1390 fort=1to600:next:pokewf,32:pokewf-3,0:pokewf-4,0:return
  139. 1400 data 22,96,120,25,30,120,28,49,120
  140. 1410 data 33,135,325,28,49,110,33,135,1000
  141.