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 >
Wrap
Commodore BASIC
|
2022-10-26
|
8KB
|
229 lines
1 poke53281,0:poke53280,0:poke788,52:gosub5000:gosub4000
2 c=2314:gosub9:print"< space >":poke198,0:wait198,1:print"[147]"
5 gosub20:goto50
6 rem----------------------------------
7 rem cursor positionieren ->c: zeile*100 + spalte
9 poke214,c/100:poke211,c-peek(214)*100:sys58732:return
17 rem---------------------------------
18 rem initialisierung und erstellung des spielfeldes
20 dimr(12),v(3,12),w(15),h(3),s(3),k(5),a(3)
25 w$=" [194][194][194][194][194][194][194][194][194][194][194][194]":c=2003:gosub9
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
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]
40 [153]w$:[153]" /tantan>tantan>tantan>tantan>tantan>tantan>tantan>tantan>tantan>tantan>tantanexp";:[142]
47 [143]---------------------------------
48 [143] hauptschleife
50 [141]100
60 [129]k[178]1[164]3:[139]h(k)[178]8[167]2000
70 [130]:[137]50
97 [143]---------------------------------
98 [143] wuerfelrunde
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
110 [145]k(k)[141]400,410,420,430,440,450
120 [130]:[153]"totototototototototototototototototototototototototototototototototototototototo"
127 [143]--------------------------------
128 [143] test, wieviele streichzahlen moeglich sind (0,1,mehr)
129 [143] r: vorherige sz (wg. doppelter!) <-a=0,a=1; a>1 => mehrere sz!
130 a[178]0:r[178]0:[129]k[178]1[164]5:[129]l[178]1[164]an
140 [139]k(k)[178]s(l)[175]r[179][177]l[167]a[178]a[170]1:r[178]l:w[178]k
150 [130]l,k:[139]an[179]3[167]190
159 [143] wenn nur eine streichzahl, dann w=wuerfelnr. & r:sz-nr.
160 [139]a[178]1[167]k(w)[178]k(5):[141]500:h(r)[178]h(r)[170]1:[141]700:[142]
170 [139]a[178]0[167][141]1100:[142]
189 [143] berechnung aller paare in v(r,i) (streichzahl -> k(5) !)
190 [129]r[178]1[164]an:a(r)[178]0:[129]k[178]1[164]5
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
210 [130]k,r
247 [143]--------------------------------
248 [143] ausgabe aller moeglichen paare
250 z[178]0:[129]k[178]1[164]an
260 [139]a(k)[178]0[167]290
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
280 [153]"open"l"cmd)"v(k,l)"/"v(k,l[170]a(k)):[130]
290 [130]:[139]z[167]c[178]1411:[141]9:[153]"listmoegliche paare"
297 [143]--------------------------------
298 [143] auswertung eingabe streichzahl
300 e$[178]"contstreichzahl":a[178]6:[141]1005
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
315 [130]:[139]z[167][141]510:[137]300
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
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
340 [130]:[139]z[167][141]520:[137]300
350 [139]an[178]3[176]r[179][178]an[167]390
360 [141]1600:c[178]1809:[141]9:[153]"defneue streichzahl:"s(r):[141]700:[141]1600
370 [139]e[178]0[167]s(an[170]1)[178]0:h(an[170]1)[178]0:[137]250
380 an[178]an[170]1:[139]an[178]3[167][141]460
385 [142]
390 a[178]a(r):[139]a[178]1[167][141]1300:[142]
395 [141]1000:[141]800:[142]
397 [143]--------------------------------
398 [143] ausgabe der wuerfel
400 [153]"for cmdcmdcmd (NULL) cmdcmdcmd ":[142]
410 [153]"(NULL) cmdcmdcmd cmdcmdcmd (NULL)":[142]
420 [153]"clr(NULL) cmdcmdcmd (NULL) cmdcmdcmd (NULL)":[142]
430 [153]"(NULL) (NULL)cmdcmdcmd cmdcmdcmd(NULL) (NULL)":[142]
440 [153]"(NULL) (NULL)cmdcmdcmd (NULL) cmdcmdcmd(NULL) (NULL)":[142]
450 [153]"sys(NULL) (NULL)cmdcmdcmd(NULL) (NULL)cmdcmdcmd(NULL) (NULL)":[142]
458 [143] -------------------------------
459 [143] ordnen der streichzahlen
460 [129]k[178]1[164]2:[129]l[178]k[170]1[164]3
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
480 [130]l,k:[141]850:[142]
497 [143]--------------------------------
498 [143] meldungen (500/510/520)
499 [143] loeschen einer meldung (550)
500 c[178]1804:[141]9:[153]"contdie einzige streichzahl istsys"s(r)"cont!":[142]
510 c[178]1803:[141]9:[153]"openhaha, sie haben keinesys"e"opengewuerfelt !":[137]550
520 c[178]1800:[141]9:[153]"open"e"sysist keine streichzahl,opensie schummler!"
550 [129]k[178]1[164]2000:[130]:[153]"on ":[142]
597 [143]--------------------------------
598 [143] moegliche paare bilden
599 [143] ->r:streichzahlnummer; <-a:anzahl der moeglichkeiten
600 v(r,1)[178]k(1)[170]k(2):v(r,4)[178]k(3)[170]k(4)
610 v(r,2)[178]k(1)[170]k(3):v(r,5)[178]k(2)[170]k(4)
620 v(r,3)[178]k(1)[170]k(4):v(r,6)[178]k(2)[170]k(3)
630 x[178]0:[129]k[178]1[164]3:m[178]v(r,k):n[178]v(r,k[170]3)
640 [141]900:[130]
650 [141]950:[142]
697 [143]--------------------------------
698 [143] ausgabe paare bei einer sz.
700 [129]k[178]1[164]1500:[130]:[141]1600
710 [141]600:[141]1200:[142]
797 [143]--------------------------------
798 [143] neuen spielstand anzeigen (vorher r(i) entspr. erhoehen)
799 [143] up 850: streichzahlen anzeigen
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
810 [141]1600:[129]k[178]2[164]12
820 c[178]3[172]k[171]2[171][180]([181](r(k)[173]10))[170]2300:[141]9
830 [151]646,((r(k)[178]0)[171](r(k)[179]5)[171]4[172](r(k)[177]4)):[153]r(k)
840 [130]:c[178]2300:[141]9:[153]""w$
850 [129]k[178]1[164]3:[139]s(k)[178]0[167]870
860 c[178]604[170]k[172]12[171]10:[141]9:[153]"sys"s(k)"cmd wait open("[201]([196](h(k)),1)")"
870 [130]:[142]
897 [143]--------------------------------
898 [143] doppelte paare ausmerzen (up900: vorbereitung)
899 [143] ->m,n: zahlenpaar -> w(i) -> v(r,i)/v(r,i+a): zahlenpaar
900 [139]m[177]n[167]h[178]m:m[178]n:n[178]h
910 x[178]x[170]1:w(x)[178]m[172]100[170]n:[142]
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
960 [130]:[139]z[167]a[178]a[170]1:w(a)[178]w(k)
970 [130]
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
990 [130]:[142]
997 [143]--------------------------------
998 [143] zifferneingabe (1000/1005)
999 [143] ->e$: frage; a: maximalzahl <-e: zahl
1000 e$[178]"syswelches paar"
1005 c[178]1811:[141]9:[153]e$" ? wait cmdcmd";
1010 [151]198,0:[146]198,1:[161]a$:e[178][197](a$):[139]a$[177]")"[175]a$[179]"A"[167][153]a$;
1020 [151]198,0:[146]198,1:[161]a$:[139]a$[179][177][199](13)[167]1005
1030 [139]e[177]a[176](e[179]1[175](an[178]3[176]r[179][178]an))[167]1005
1040 [142]
1097 [143]-------------------------------
1098 [143] freiwurf
1100 r[178]0:c[178]1814:[141]9:[153]"freiwurf!":[141]550
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
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
1120 [129]k[178]5[164]7:m[178]v(0,15[171]k):n[178]v(0,k):[141]900:[130]
1130 x[178]15:[141]950:[141]1200:[142]
1197 [143]-------------------------------
1198 [143] ausgabe moegliche paare und eingabe paarnummer
1199 [143] ->a: anzahl der paare <-e: nummer des paares
1200 [139]a[178]1[175]an[178]3[167][141]1300:[142]
1210 c[178]1011:[141]9:[153]"listmoegliche paare:":t[178]6:[139]a[179]4[167]t[178]12
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
1230 [153][163]t)"open"k"cmd) "v(r,k)"/"v(r,a[170]k):[130]:[141]1000
1240 [139]e[167][141]800
1250 [142]
1297 [143]-------------------------------
1298 [143] nur ein paar moeglich! e=1: nummer des paares
1300 c[178]1802:[141]9:[153]"cont einzig moegliches paar ist :for"v(r,1)"/for"v(r,2)
1310 [129]k[178]1[164]1500:[130]:e[178]1:[141]800:[142]
1597 [143]-------------------------------
1598 [143] loeschen des spielfeldes mit oder ohne pause vorher
1600 c[178]700:[141]9:[129]k[178]1[164]13:[153]" "
1610 [130]:[142]
1997 [143]-------------------------------
1998 [143] ende eines spiels
2000 [129]k[178]1[164]999:[130]:[153]"loaddas war ihr sysletzterwait wurf in diesem spiel"
2010 [153][163]51)"kommen wir nun zur":[153][163]13)"auswertung..."
2015 [129]k[178]1[164]1500:[130]
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
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)
2040 [139]k[178]8[167]c[178]700:[141]9:t[178]22
2050 s$[178][201](" "[170][196](s),3)
2060 [153][163]t[171][195]([196](k)))""k"print#:sys"[201]([196](r(k)),2)"open =clr"s$"def punkte"
2070 su[178]su[170]s:[130]
2080 [153][163]128)"insgesamt "su"cmd punkte":[153][163]14)"cont< space >"
2090 [161]a$:[139]a$[179][177]" "[167]2090
2100 [141]3000:[141]4000:c[178]2206:[141]9:[153]"contnochmal spielen < j / n >"
2110 [151]198,0:[146]198,1:[161]a$:[139]a$[178]"n"[167][158]64738
2120 [153]"load":[156]:[137]5
2997 [143]-------------------------------
2998 [143] neuer highscore ? wenn ja, dann namenseingabe
3000 h[178]0:[129]k[178]1[164]10:[139]su[177][194](827[170]k)[167]h[178]k:k[178]10
3005 [130]:[139]h[178]0[167][142]
3010 [129]k[178]1[164]10[171]h:[151]838[171]k,[194](837[171]k):[130]:[151]827[170]h,su
3015 [139]h[179]10[167][151]983,h[172]10[170]60:[158]982
3020 [153]"load":c[178]1002:[141]9:[153]"defgratuliere, neuer highscore!"
3030 [153]" sie erreichten platzsys"h"def!"
3040 [153]"cont geben sie ihren namen ein:"
3050 c[178]1428:[141]9:[153]"..........":c[178]1428:[141]9
3060 [129]k[178]1[164]10
3070 [151]198,0:[146]198,1:[161]a$:[139]a$[178][199](20)[167]k[178]10:[130]:[137]3050
3080 [139]a$[179]" "[176]a$[177]"_"[176]a$[178][199](34)[167]3070
3090 [153]a$;:[151]827[170]10[172]h[170]k,[198](a$)
3100 [130]:[151]198,0:[146]198,1:[161]a$:[139]a$[179][177][199](13)[167]3050
3110 [153]"stop":[158]938:[142]
3997 [143]-------------------------------
3998 [143] ausgabe highscores
4000 [153]"load"[163]14)"syshighscores"
4010 [129]k[178]1[164]10:c[178]k[172]200[170]6:[141]9:[151]646,k
4020 [153][194](827[170]k)"punkte : ";
4030 [129]l[178]1[164]10:[153][199]([194](827[170]k[172]10[170]l));:[130]l
4040 [153]"wait":[130]k
4050 [142]
4997 [143]-------------------------------
4998 [143] titelbild ausgeben und highscores laden
5000 [153]"load"[199](142)[199](8):[153][163]13)"print sys clr open "
5001 [153][163]13)"print sys clr open "
5002 [153][163]13)"print sys clr open "
5003 [153][163]13)"print sys clr open "
5004 [153][163]13)"print sys clr open "
5009 [153]"sys open cont print clr sys"
5010 [153]"sys open cont print clr sys"
5020 [153]" open cont print clr sys"
5030 [153]" open cont print clr sys"
5040 [153]" open cont print clr "
5045 [153][163]7)"written and performed by"
5050 [153]"for open def sys list "
5060 [153]"for open def sys list "
5070 [153]"for open def sys list "
5080 [153]"for open def sys list "
5090 [153]"for open def sys list ";
5100 [158]57812"wuerfeln.sc",8,1:[151]780,0:[158]65493
5110 [129]k[178]1[164]1500:[130]:k[178][187]([171]ti):[142]
6000 [131]8,9,10,6,7,10,5,7,9,5,6,8
9000 r(i): haeufigkeit der augensumme i
9002 s(3): streichzah[195]
9004 h(i): haeufigkeit d. streichzahl i
9006 a(i): anzahl paare bei streichz. i
9008 v(i,k):zah[195]paare bei streichz. i
9010 w(x): paare in komprimierter [129]m
9012 k(5): augenzah[195] bei einem wurf
9014 an: zaehler fuer streichzah[195]
9016 c: curs[176][185]iti[145]
9018 x: moegliche paare (auch doppelte) n[176]mal: 3[173][184]iwurf: 15
9020 z: universalflag
9022 a: universal[171]'maximum'
9024 t: ausgabetabula[164]r
9026 w: wuerfelnummer
9028 r: streichzahlnummer
9030 a$: eingabezeichen
9032 e: eingabevariable
9034 h: hilfsvariable
9036 k,l:schle[139]envariable
9038 s: punktzahl pro augensumme
9040 s$: [129]matierte punktzahl
9042 su: gesamtpunktzahl