home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 78
/
078.d81
/
journal
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
835b
|
31 lines
5 poke53281,0:poke53280,0:print"[147][159]"
10 pr$(0)="heads":pr$(1)="tails"
20 nr=0: rem nr=number right
30 pr=0: rem pr=prediction
40 r=0: rem r =random value
50 he=0: rem he=heads tally
60 ta=0: rem ta=tails tally
70 lf=0: rem lf=last flip, 0 = heads, 1 = tails
80 x=rnd(-ti)
90 fort=1to100
100 pr=0:if he>ta then pr=1
110 if he=ta then pr=(lf+1)and1
120 r=rnd(1)
130 ifr<.5 then lf=0:he=he+1
140 ifr=>.5 then lf=1:ta=ta+1
150 ifpr=lf then nr=nr+1
160 printttab(6)"[208]rediction: "pr$(pr)
170 printtab(10)"[210]esult: "pr$(lf)
180 print,,"[206]umber heads="he
190 print,,"[206]umber tails="ta"
200 [153],,"(NULL)umber right="nr
210 [130]
300 [153]"cont ((NULL)cont)ry it again ((NULL)cont)enu":[151]198,0
310 [161]a$:[139]a$[179][177]"t"[175]a$[179][177]"m"[167]310
320 [139]a$[178]"t"[167][138]
330 [159]15,8,15,"r0:hello connect=hello connect":[132]15,er:[160]15
340 [139]er[179][177]63[167][128]
350 [153]"loadstopload"[199](34)"hello connect"[199](34)",8"
360 [153]"run"
370 [151]631,13:[151]632,13:[151]198,2:[128]