home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 225
/
225.d81
/
petris
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
1KB
|
20 lines
1 poke53281,14:rem petris (c)2002 curtis f kaylor
2 t$=" "
3 dimt$(15):fori=0to15:t$(i)=mid$(t$,4*i+1,4):next:dimb%(6,3,3):dimp(23)
4 b$="dddd@o@@dddd@o@@@fdd@ga@@aac@dg@@fbb@ag@@ddf@gd@@bfb@bg@@bcb@gb@@acb@fc@"
5 b$=b$+"@acb@fc@@dfb@cf@@dfb@cf@@ff@@ff@@ff@@ff@":fori=0to6:forj=0to3:fork=0to3
6 z=z+1:b%(i,j,k)=asc(mid$(b$,z))and15:next:next:next:fori=0to19:p(i)=4097:next:p(i)=8191
7 print"[147]":fori=0to20:p=p(i):print""t$(p/4096)t$(p/256and15)t$(p/16and15)t$(pand15):next
8 print "[145]petris";s
9 x=5:y=0:b=7*rnd(0):c=0:d=2:print"";:r=1
10 ifrthend$="":fori=0to3:d$=d$+t$(b%(b,c,i))+"[157][157][157][157]":next:d$=d$+"[145][145][145][145]"
11 print chr$(93*abs(m)+64*m)"";d$;:if m+r then m=0:r=0:goto14
12 get k$:m=(k$="")-(k$=""):r=(k$=" "):ifmthenx=x+m:gosub16:ifzthenx=x-m:m=0
13 ifrthenc=c-rand3:gosub16:ifzthenc=c+rand3:r=0
14 if m+r=0 then y=y+1:gosub16:if z then y=y-1:onsgn(y)goto17:end
15 print"[146]"d$;chr$(-17*(m+r=0));:goto10
16 z=0:t=2^x:fori=0to3:z=z+(p(y+i)andb%(b,c,i)*t):next:return
17 a=0:fori=0to3:p(y+i)=p(y+i)orb%(b,c,i)*t:ifp(y+i)=8191andy+i<20thengosub19
18 next:ondgoto7,9
19 forz=y+ito1step-1:p(z)=p(z-1):next:p(0)=4097:d=1:a=a+10:s=s+a:return