Retrocomputer, Emulazione, Riparazioni Scambi/Vendite e collezionismo - Cerco Commodore - Approfondimenti, Listati Basic Commodore

Commodore CErco COmmodore - l'iniziativa di appassionati di retrocomputer


Listato per il basic del Commodore 128 che disegna una roulette.

Il programma sfrutta tutte le potenzialità notevoli del basic 7.0 del C128. La roulette si avvia premendo il tasto N.

        1060 graphic 3,1:color 1,6:color 3,11
        1070 color 2,2:color 0,1:color 4,7
        1080 sound 1,0,0:sound 2,0,0
        1090 sound 3,0,0:vol 10
        1100 print chr$(142)
        1110 for a=1 to 8
        1120 sprite a,0:next a
        1140 dim p(37):dim i(37):dim num$(37)
        1150 c=1:l=3:h=4
        1160 for a=0 to 353 step 9.729
        1170 k==/180*a
        1180 x=75*cos(k)+45
        1190 y=90*sin(k)+91
        1200 read p,i,n$
        1210 p(c)=p:i(c)=i:num$(c)=n$:c=c+1
        1220 if p=2 then z=2
        1230 if p=6 then z=1
        1240 if p=2 or p=6 then gosub 1390
        1250 x=x-1
        1260 if i=1 then z=0
        1270 if i=3 then z=3
        1280 n=asc(left$(n$,1))-48
        1290 gosub 1730
        1300 x=x+5
        1310 n=asc(right$(n$,1))-48
        1320 gosub 1730
        1330 next a
        1340 l=5:h=8
        1350 r=50+int(rnd(1)*75)
        1360 get k$
        1370 if k$="n" then gosub 1430
        1380 goto 1350
        1390 for k=y-(h/2) to y+h*2+(h/2)
        1400 draw z,(x+32)-(l/2),k+4 to x+32+l*+(l/2),k+4
        1410 next k
        1420 return
        1430 v=0
        1440 for f=0 to r*9.729 step 9.729
        1450 v=v+1:if v=38 then v=1
        1460 draw 0,a+32,b+4
        1470 draw 0,a+33,b+4
        1480 draw 0,a+32,b+5
        1490 draw 0,a+33,b+5
        1500 k==/180*f
        1510 a=65*cos(k)+47
        1520 b=78*sin(k)+94
        1530 draw 2,a+32,b+4
        1540 draw 2,a+33,b+4
        1550 draw 2,a+32,b+5
        1560 draw 2,a+33,b+5
        1570 sound 2,50,10
        1580 next f
        1590 x=40:y=86:i=i(v):p=p(v)
        1600 if p=2 then z=2
        1610 if p=1 then z=0
        1620 if p=6 then z=1
        1630 n$=num$(v)
        1640 gosub 1390
        1650 if i=1 then z=0
        1660 if i=3 then z=3
        1670 n=asc(left$(n$,1))-48
        1680 gosub 1730
        1690 x=x+7
        1700 n=asc(right$(n$,1))-48
        1710 gosub 1730
        1720 return
        1730 if n=-16 then return
        1740 if n=0 or n=2 or n=3 or n=5 or n=6 or n=7 or n=8 or n=9 then draw z,x+32,y+4 to x+32+l,y+4
        1750 if n=0 or n=3 or n=4 or n=5 or n=6 or n=8 or n=9 then draw z,x+32,y+4+h to x+32+l,y+4+h
        1760 if n=0 or n=2 or n=3 or n=5 or n=6 or n=8 or n=9 then draw z,x+32,y+4+h+h to x+32+l,y+4+h+h
        1770 if n=0 or n=1 or n=2 or n=3 or n=4 or n=7 or n=8 or n=9 then draw z,x+32+l,y+4 to x+32+l,y+4+h
        1780 if n=0 or n=1 or n=3 or n=4 or n=5 or n=6 or n=7 or n=8 or n=9 then draw z,x+32+l,y+4+h to x+32+l,y+4+h+h
        1790 if n=0 or n=2 or n=6 or n=8 then draw z,x+32,y+4+h to x+32,y+4+h+h
        1800 if n=0 or n=4 or n=5 or n=6 or n=8 or n=9 then draw z,x+32,y+4 to x+32,y+4+h
        1810 return
        1820 data 1,3,"5 ",2,1,"24",1,3,"16",2,1,"33",1,3,"1 "
        1830 data 2,1,"20",1,3,"14",2,1,"31",1,3,"9 ",2,1,"22"
        1840 data 1,3,"18",2,1,"29",1,3," 7",2,1,"28",1,3,"12"
        1850 data 2,1,"35",1,3," 3",2,1,"26",6,1," 0",1,3,"32"
        1860 data 2,1,"15",1,3,"19",2,1," 4",1,3,"21",2,1," 2"
        1870 data 1,3,"25",2,1,"17",1,3,"34",2,1,"6 ",1,3,"27"
        1880 data 2,1,"13",1,3,"36",2,1,"11",1,3,"30",2,1,"8 "
        1890 data 1,3,"23",2,1,"10"
		  

Torna indietro



Copyright 2003 - 2018 (c) - Tutti i diritti riservati -