home *** CD-ROM | disk | FTP | other *** search
/ 64'er Special 37 / 64er_Magazin_Sonderheft_37_19xx_Markt__Technik_de_Disk_2_of_2_Side_B.d64 / solowuerfeln (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  8KB  |  229 lines

  1. 1 poke53281,0:poke53280,0:poke788,52:gosub5000:gosub4000
  2. 2 c=2314:gosub9:print"< space >":poke198,0:wait198,1:print"[147]"
  3. 5 gosub20:goto50
  4. 6 rem----------------------------------
  5. 7 rem      cursor positionieren                  ->c: zeile*100 + spalte
  6. 9 poke214,c/100:poke211,c-peek(214)*100:sys58732:return
  7. 17 rem---------------------------------
  8. 18 rem      initialisierung und                  erstellung des spielfeldes
  9. 20 dimr(12),v(3,12),w(15),h(3),s(3),k(5),a(3)
  10. 25 w$="   [194][194][194][194][194][194][194][194][194][194][194][194]":c=2003:gosub9
  11. 30 print"[176][192][192][178][192][192][178][192][192][178][192][192][178][192][192][178][192][192][178][192][192][178][192][192][178][192][192][178][192][192][178][192][192][174]":fork=2to12:c=3*k-2-int(k/10)+2100
  12. 35 gosub9:print"[158]"k:next:print"[145]"w$:print"   [171][192][192][219][192][192][219][192][192][219][192][192][219][192][192][219][192][192][219][192][192][219][192][192][219][192][192][219][192][192][219][192][192][179]
  13. 40 [153]w$:[153]"   /tantan>tantan>tantan>tantan>tantan>tantan>tantan>tantan>tantan>tantan>tantanexp";:[142]
  14. 47 [143]---------------------------------
  15. 48 [143]        hauptschleife
  16. 50 [141]100
  17. 60 [129]k[178]1[164]3:[139]h(k)[178]8[167]2000
  18. 70 [130]:[137]50
  19. 97 [143]---------------------------------
  20. 98 [143]         wuerfelrunde
  21. 100 [129]k[178]1[164]5:k(k)[178][181](6[172][187](1))[170]1:c[178]100[170]k[172]6:[141]9
  22. 110 [145]k(k)[141]400,410,420,430,440,450
  23. 120 [130]:[153]"totototototototototototototototototototototototototototototototototototototototo"
  24. 127 [143]--------------------------------
  25. 128 [143] test, wieviele streichzahlen            moeglich sind (0,1,mehr)
  26. 129 [143] r: vorherige sz (wg. doppelter!)      <-a=0,a=1; a>1 => mehrere sz!
  27. 130 a[178]0:r[178]0:[129]k[178]1[164]5:[129]l[178]1[164]an
  28. 140 [139]k(k)[178]s(l)[175]r[179][177]l[167]a[178]a[170]1:r[178]l:w[178]k
  29. 150 [130]l,k:[139]an[179]3[167]190
  30. 159 [143] wenn nur eine streichzahl, dann         w=wuerfelnr. & r:sz-nr.
  31. 160 [139]a[178]1[167]k(w)[178]k(5):[141]500:h(r)[178]h(r)[170]1:[141]700:[142]
  32. 170 [139]a[178]0[167][141]1100:[142]
  33. 189 [143] berechnung aller paare in v(r,i)        (streichzahl -> k(5) !)
  34. 190 [129]r[178]1[164]an:a(r)[178]0:[129]k[178]1[164]5
  35. 200 [139]s(r)[178]k(k)[167]k(k)[178]k(5):[141]600:a(r)[178]a:k(5)[178]k(k):k(k)[178]s(r):k[178]5
  36. 210 [130]k,r
  37. 247 [143]--------------------------------
  38. 248 [143] ausgabe aller moeglichen paare
  39. 250 z[178]0:[129]k[178]1[164]an
  40. 260 [139]a(k)[178]0[167]290
  41. 270 z[178]1:[129]l[178]1[164]a(k):c[178]600[170]l[172]200[170]k[172]12[171]9:[141]9
  42. 280 [153]"open"l"cmd)"v(k,l)"/"v(k,l[170]a(k)):[130]
  43. 290 [130]:[139]z[167]c[178]1411:[141]9:[153]"listmoegliche paare"
  44. 297 [143]--------------------------------
  45. 298 [143] auswertung eingabe streichzahl
  46. 300 e$[178]"contstreichzahl":a[178]6:[141]1005
  47. 310 z[178]1:[129]k[178]1[164]5:[139]k(k)[178]e[167]z[178]0:k(k)[178]k(5):k(5)[178]e:k[178]5
  48. 315 [130]:[139]z[167][141]510:[137]300
  49. 320 [139]an[179]3[167][139]e[179][177]s(1)[175]e[179][177]s(2)[167]s(an[170]1)[178]e
  50. 330 z[178]1:r[178]3:[129]k[178]1[164]r:[139]e[178]s(k)[167]z[178]0:h(k)[178]h(k)[170]1:r[178]k
  51. 340 [130]:[139]z[167][141]520:[137]300
  52. 350 [139]an[178]3[176]r[179][178]an[167]390
  53. 360 [141]1600:c[178]1809:[141]9:[153]"defneue streichzahl:"s(r):[141]700:[141]1600
  54. 370 [139]e[178]0[167]s(an[170]1)[178]0:h(an[170]1)[178]0:[137]250
  55. 380 an[178]an[170]1:[139]an[178]3[167][141]460
  56. 385 [142]
  57. 390 a[178]a(r):[139]a[178]1[167][141]1300:[142]
  58. 395 [141]1000:[141]800:[142]
  59. 397 [143]--------------------------------
  60. 398 [143]     ausgabe der wuerfel
  61. 400 [153]"for   cmdcmdcmd (NULL) cmdcmdcmd   ":[142]
  62. 410 [153]"(NULL)  cmdcmdcmd   cmdcmdcmd  (NULL)":[142]
  63. 420 [153]"clr(NULL)  cmdcmdcmd (NULL) cmdcmdcmd  (NULL)":[142]
  64. 430 [153]"(NULL) (NULL)cmdcmdcmd   cmdcmdcmd(NULL) (NULL)":[142]
  65. 440 [153]"(NULL) (NULL)cmdcmdcmd (NULL) cmdcmdcmd(NULL) (NULL)":[142]
  66. 450 [153]"sys(NULL) (NULL)cmdcmdcmd(NULL) (NULL)cmdcmdcmd(NULL) (NULL)":[142]
  67. 458 [143] -------------------------------
  68. 459 [143]    ordnen der streichzahlen
  69. 460 [129]k[178]1[164]2:[129]l[178]k[170]1[164]3
  70. 470 [139]s(k)[177]s(l)[167]h[178]s(k):s(k)[178]s(l):s(l)[178]h:h[178]h(k):h(k)[178]h(l):h(l)[178]h
  71. 480 [130]l,k:[141]850:[142]
  72. 497 [143]--------------------------------
  73. 498 [143]    meldungen (500/510/520)
  74. 499 [143]   loeschen einer meldung (550)
  75. 500 c[178]1804:[141]9:[153]"contdie einzige streichzahl istsys"s(r)"cont!":[142]
  76. 510 c[178]1803:[141]9:[153]"openhaha, sie haben keinesys"e"opengewuerfelt !":[137]550
  77. 520 c[178]1800:[141]9:[153]"open"e"sysist keine streichzahl,opensie schummler!"
  78. 550 [129]k[178]1[164]2000:[130]:[153]"on                                       ":[142]
  79. 597 [143]--------------------------------
  80. 598 [143]     moegliche paare bilden
  81. 599 [143] ->r:streichzahlnummer;                  <-a:anzahl der moeglichkeiten
  82. 600 v(r,1)[178]k(1)[170]k(2):v(r,4)[178]k(3)[170]k(4)
  83. 610 v(r,2)[178]k(1)[170]k(3):v(r,5)[178]k(2)[170]k(4)
  84. 620 v(r,3)[178]k(1)[170]k(4):v(r,6)[178]k(2)[170]k(3)
  85. 630 x[178]0:[129]k[178]1[164]3:m[178]v(r,k):n[178]v(r,k[170]3)
  86. 640 [141]900:[130]
  87. 650 [141]950:[142]
  88. 697 [143]--------------------------------
  89. 698 [143]   ausgabe paare bei einer sz.
  90. 700 [129]k[178]1[164]1500:[130]:[141]1600
  91. 710 [141]600:[141]1200:[142]
  92. 797 [143]--------------------------------
  93. 798 [143]  neuen spielstand anzeigen               (vorher r(i) entspr. erhoehen)
  94. 799 [143]  up 850: streichzahlen anzeigen
  95. 800 r(v(r,e))[178]r(v(r,e))[170]1:r(v(r,a[170]e))[178]r(v(r,a[170]e))[170]1
  96. 810 [141]1600:[129]k[178]2[164]12
  97. 820 c[178]3[172]k[171]2[171][180]([181](r(k)[173]10))[170]2300:[141]9
  98. 830 [151]646,((r(k)[178]0)[171](r(k)[179]5)[171]4[172](r(k)[177]4)):[153]r(k)
  99. 840 [130]:c[178]2300:[141]9:[153]""w$
  100. 850 [129]k[178]1[164]3:[139]s(k)[178]0[167]870
  101. 860 c[178]604[170]k[172]12[171]10:[141]9:[153]"sys"s(k)"cmd wait open("[201]([196](h(k)),1)")"
  102. 870 [130]:[142]
  103. 897 [143]--------------------------------
  104. 898 [143]    doppelte paare ausmerzen                 (up900: vorbereitung)
  105. 899 [143] ->m,n: zahlenpaar -> w(i) ->              v(r,i)/v(r,i+a): zahlenpaar
  106. 900 [139]m[177]n[167]h[178]m:m[178]n:n[178]h
  107. 910 x[178]x[170]1:w(x)[178]m[172]100[170]n:[142]
  108. 950 a[178]1:[129]k[178]2[164]x:z[178]1:[129]l[178]1[164]a:[139]w(k)[178]w(l)[167]z[178]0
  109. 960 [130]:[139]z[167]a[178]a[170]1:w(a)[178]w(k)
  110. 970 [130]
  111. 980 [129]k[178]1[164]a:v(r,k)[178][181](w(k)[173]100):v(r,a[170]k)[178]w(k)[171]v(r,k)[172]100
  112. 990 [130]:[142]
  113. 997 [143]--------------------------------
  114. 998 [143]   zifferneingabe (1000/1005)
  115. 999 [143] ->e$: frage; a: maximalzahl             <-e: zahl
  116. 1000 e$[178]"syswelches paar"
  117. 1005 c[178]1811:[141]9:[153]e$" ?  wait cmdcmd";
  118. 1010 [151]198,0:[146]198,1:[161]a$:e[178][197](a$):[139]a$[177]")"[175]a$[179]"A"[167][153]a$;
  119. 1020 [151]198,0:[146]198,1:[161]a$:[139]a$[179][177][199](13)[167]1005
  120. 1030 [139]e[177]a[176](e[179]1[175](an[178]3[176]r[179][178]an))[167]1005
  121. 1040 [142]
  122. 1097 [143]-------------------------------
  123. 1098 [143]        freiwurf
  124. 1100 r[178]0:c[178]1814:[141]9:[153]"freiwurf!":[141]550
  125. 1105 a[178]0:[129]k[178]1[164]4:[129]l[178]k[170]1[164]5:a[178]a[170]1:v(0,a)[178]k(k)[170]k(l):[130]l,k
  126. 1110 [140]:x[178]0:[129]k[178]1[164]4:[129]l[178]1[164]3:[135]m:m[178]v(0,m):n[178]v(0,k):[141]900:[130]l,k
  127. 1120 [129]k[178]5[164]7:m[178]v(0,15[171]k):n[178]v(0,k):[141]900:[130]
  128. 1130 x[178]15:[141]950:[141]1200:[142]
  129. 1197 [143]-------------------------------
  130. 1198 [143] ausgabe moegliche paare und             eingabe paarnummer
  131. 1199 [143] ->a: anzahl der paare                   <-e: nummer des paares
  132. 1200 [139]a[178]1[175]an[178]3[167][141]1300:[142]
  133. 1210 c[178]1011:[141]9:[153]"listmoegliche paare:":t[178]6:[139]a[179]4[167]t[178]12
  134. 1220 [129]k[178]1[164]a:[139]k[178]a[173]2[170]1[175]a[177]3[167]c[178]1100:[141]9:t[178]19
  135. 1230 [153][163]t)"open"k"cmd) "v(r,k)"/"v(r,a[170]k):[130]:[141]1000
  136. 1240 [139]e[167][141]800
  137. 1250 [142]
  138. 1297 [143]-------------------------------
  139. 1298 [143]   nur ein paar moeglich!                  e=1: nummer des paares
  140. 1300 c[178]1802:[141]9:[153]"cont einzig moegliches paar ist :for"v(r,1)"/for"v(r,2)
  141. 1310 [129]k[178]1[164]1500:[130]:e[178]1:[141]800:[142]
  142. 1597 [143]-------------------------------
  143. 1598 [143]   loeschen des spielfeldes                mit oder ohne pause vorher
  144. 1600 c[178]700:[141]9:[129]k[178]1[164]13:[153]"                                       "
  145. 1610 [130]:[142]
  146. 1997 [143]-------------------------------
  147. 1998 [143]       ende eines spiels
  148. 2000 [129]k[178]1[164]999:[130]:[153]"loaddas war ihr sysletzterwait wurf in diesem spiel"
  149. 2010 [153][163]51)"kommen wir nun zur":[153][163]13)"auswertung..."
  150. 2015 [129]k[178]1[164]1500:[130]
  151. 2020 t[178]2:[129]k[178]2[164]12:s[178]0:[139]r(k)[177]0[175]r(k)[179]5[167]s[178][171]20
  152. 2030 [139]r(k)[177]5[167]h[178][182](k[171]7):s[178](h[170]3[171]2[172](h[178]5))[172](r(k)[171]5)
  153. 2040 [139]k[178]8[167]c[178]700:[141]9:t[178]22
  154. 2050 s$[178][201](" "[170][196](s),3)
  155. 2060 [153][163]t[171][195]([196](k)))""k"print#:sys"[201]([196](r(k)),2)"open =clr"s$"def punkte"
  156. 2070 su[178]su[170]s:[130]
  157. 2080 [153][163]128)"insgesamt "su"cmd punkte":[153][163]14)"cont< space >"
  158. 2090 [161]a$:[139]a$[179][177]" "[167]2090
  159. 2100 [141]3000:[141]4000:c[178]2206:[141]9:[153]"contnochmal spielen  < j / n >"
  160. 2110 [151]198,0:[146]198,1:[161]a$:[139]a$[178]"n"[167][158]64738
  161. 2120 [153]"load":[156]:[137]5
  162. 2997 [143]-------------------------------
  163. 2998 [143]       neuer highscore ?                 wenn ja, dann namenseingabe
  164. 3000 h[178]0:[129]k[178]1[164]10:[139]su[177][194](827[170]k)[167]h[178]k:k[178]10
  165. 3005 [130]:[139]h[178]0[167][142]
  166. 3010 [129]k[178]1[164]10[171]h:[151]838[171]k,[194](837[171]k):[130]:[151]827[170]h,su
  167. 3015 [139]h[179]10[167][151]983,h[172]10[170]60:[158]982
  168. 3020 [153]"load":c[178]1002:[141]9:[153]"defgratuliere, neuer highscore!"
  169. 3030 [153]"  sie erreichten platzsys"h"def!"
  170. 3040 [153]"cont geben sie ihren namen ein:"
  171. 3050 c[178]1428:[141]9:[153]"..........":c[178]1428:[141]9
  172. 3060 [129]k[178]1[164]10
  173. 3070 [151]198,0:[146]198,1:[161]a$:[139]a$[178][199](20)[167]k[178]10:[130]:[137]3050
  174. 3080 [139]a$[179]" "[176]a$[177]"_"[176]a$[178][199](34)[167]3070
  175. 3090 [153]a$;:[151]827[170]10[172]h[170]k,[198](a$)
  176. 3100 [130]:[151]198,0:[146]198,1:[161]a$:[139]a$[179][177][199](13)[167]3050
  177. 3110 [153]"stop":[158]938:[142]
  178. 3997 [143]-------------------------------
  179. 3998 [143]       ausgabe highscores
  180. 4000 [153]"load"[163]14)"syshighscores"
  181. 4010 [129]k[178]1[164]10:c[178]k[172]200[170]6:[141]9:[151]646,k
  182. 4020 [153][194](827[170]k)"punkte :   ";
  183. 4030 [129]l[178]1[164]10:[153][199]([194](827[170]k[172]10[170]l));:[130]l
  184. 4040 [153]"wait":[130]k
  185. 4050 [142]
  186. 4997 [143]-------------------------------
  187. 4998 [143]      titelbild ausgeben                     und highscores laden
  188. 5000 [153]"load"[199](142)[199](8):[153][163]13)"print   sys   clr open   "
  189. 5001 [153][163]13)"print sys  clr open  "
  190. 5002 [153][163]13)"print   sys  clr open  "
  191. 5003 [153][163]13)"print sys  clr open  "
  192. 5004 [153][163]13)"print   sys   clr   open   "
  193. 5009 [153]"sys     open  cont         print    clr  sys"
  194. 5010 [153]"sys     open  cont    print  clr   sys"
  195. 5020 [153]"      open  cont       print   clr    sys"
  196. 5030 [153]"        open  cont    print  clr   sys"
  197. 5040 [153]"     open   cont      print      clr  "
  198. 5045 [153][163]7)"written and performed by"
  199. 5050 [153]"for    open      def   sys   list "
  200. 5060 [153]"for open   def  sys list "
  201. 5070 [153]"for   open     def   sys  list "
  202. 5080 [153]"for  open   def sys list "
  203. 5090 [153]"for    open      def sys   list   ";
  204. 5100 [158]57812"wuerfeln.sc",8,1:[151]780,0:[158]65493
  205. 5110 [129]k[178]1[164]1500:[130]:k[178][187]([171]ti):[142]
  206. 6000 [131]8,9,10,6,7,10,5,7,9,5,6,8
  207. 9000 r(i): haeufigkeit der augensumme i
  208. 9002 s(3): streichzah[195]
  209. 9004 h(i): haeufigkeit d. streichzahl i
  210. 9006 a(i): anzahl paare bei streichz. i
  211. 9008 v(i,k):zah[195]paare bei streichz. i
  212. 9010 w(x): paare in komprimierter [129]m
  213. 9012 k(5): augenzah[195] bei einem wurf
  214. 9014 an: zaehler fuer streichzah[195]
  215. 9016 c:  curs[176][185]iti[145]
  216. 9018 x:  moegliche paare (auch doppelte)         n[176]mal: 3[173][184]iwurf: 15
  217. 9020 z:  universalflag
  218. 9022 a:  universal[171]'maximum'
  219. 9024 t:  ausgabetabula[164]r
  220. 9026 w:  wuerfelnummer
  221. 9028 r:  streichzahlnummer
  222. 9030 a$: eingabezeichen
  223. 9032 e:  eingabevariable
  224. 9034 h:  hilfsvariable
  225. 9036 k,l:schle[139]envariable
  226. 9038 s:  punktzahl pro augensumme
  227. 9040 s$: [129]matierte punktzahl
  228. 9042 su: gesamtpunktzahl
  229.