01 – Buco Nero
Apparso da pagina 1 fino a pagina 8 de “Il libro dei giochi del Commodore 64”
Il listato pubblicato
Il programma

Il nostro listato digitato
Qui di seguito trovate il codice da copiare sul programma CBM prg Studio Il codice originale é stato modificato affinchè possa essere letto da CBM prg Studio. I caratteri speciali PETSCII (Screen Codes) presenti nel listato originale, sono stati singolarmente sostituiti da quelli standard utilizzati da CBM prg Studio. Attenzione – Grazie alla segnalazione di più utenti, i caratteri “<” e “>” potrebbero venir sostituiti dai rispettivi encoding html “<” e “>” . Qualora li trovaste, sostituite manualmente questi valori direttamente su CBM prg Studio, altrimenti il programma non funzionerà. Scusate per l’inconveniente tecnico.
10 rem ** buco nero **
20 print"{clear}":poke53280,6:poke53281,0:g=1024:h=55296:v=53248:s=54272
30 poke52,48:poke56,48
40 for j = 0 to 38:readx:poke 12288+j,x:next
50 for j = 0 to 23:poke 12338+j,0:next
60 poke2040,192:pokev+28,1:pokev+37,10:pokev+0,13:pokev+39,0
70 gosub 1500
80 pokes+3,8:pokes+14,164:pokes+18,32:pokes+24,143
90 fr=10000:pokes+5,133:pokes+6,240
100 print"{clear}{white}"
110 input" livello di gioco (1-10)";l$
120 l=val(l$)
130 ifl<1orl>10then100
140 x=rnd(-ti):n=1:l=(10-l)/2
150 def fnr(x)=int(rnd(1)*(x+1))
160 print"{clear}{yellow}":pokeh+38,7:pokeh+39,7
170 poke53280,0:poke53281,6
180 forj=1to25
190 printspc(fnr(60));"{up}";
200 next
210 r=fnr(24):c=fnr(39)
220 rc=fnr(24):cc=fnr(39)
230 ifabs(r-rc)<13orabs(c-cc)<21then220
240 pokev+21,1
250 gosub1050
260 ti$="000000"
270 pokeg+38,asc(mid$(ti$,5,1))
280 pokeg+39,asc(right$(ti$,1))
290 ifval(right$(ti$,3))=100then690
300 gosub900
310 pokev+37,0:pokev+38,13
320 fork=0to5*l:next
330 gosub900
340 pokev+37,10:pokev+38,0
350 fork=0to150:next
360 geta$
370 ifa$=";"thenrc=rc-n
380 ifa$="/"thenrc=rc+n
390 ifa$="z"thencc=cc-n
400 ifa$="x"thencc=cc+n
410 gosub1000
420 ra=abs(r-rc):ca=abs(c-cc)
430 ifra<2andca<2thent$=right$(ti$,2):goto520 440 ifra>12orca>20+lthenn=1:goto270
450 n=3
460 ifra<6thenrc=rc+sgn(r-rc)
470 ifra<13thenrc=rc+sgn(r-rc)
480 ifca<11thencc=cc+sgn(c-cc)
490 ifca<21+lthencc=cc+sgn(c-cc) 500 gosub1000 510 goto270 520 print"{clear}":poke53281,0:gosub1500 530 pokes+24,15:pokes+6,248:pokes+4,129 540 forfq=10to20000step100 550 hf=int(fq/256):lf=fq-hf*256 560 pokes,lf:pokes+1,hf 570 next 580 pokev+21,0:gosub1500 590 sc=int(sc*60/val(t$))-10 600 ifsc>bsthenbs=sc
610 print"{down*3}{right*3} il tuo punteggio e' ";sc
620 print"{down}{right*3}il miglior punteggio e' ";bs
630 print"{down}{right*3}il tempo impiegato e' ";t$;" sec."
640 print"{down*5} batti spazio per continuare"
650 sc=0
660 geta$:ifa$<>" "then660
670 print"{clear}":poke53281,6
680 pokev+21,0:goto60
690 print"{clear}":poke53280,7:poke53281,6
700 pokev+21,1:pokev,174:pokev+1,200:pokev+38,13
710 pokes+6,252
720 gosub900
730 fork=1to1000:next
740 gosub1500
750 t$="60"
760 print"{yellow}":goto600
900 fq=fr+peek(s+27)*4
910 hf=int(fq/256):lf=fq-hf*256
920 pokes+4,33
930 pokes,lf:pokes+1,hf
940 pokes+4,32
950 return
1000 ifrc<0thenrc=0 1010 ifrc>24thenrc=24
1020 ifcc<0thencc=0 1030 ifcc>39thencc=39
1040 x=cc*8+16:y=rc*8+50
1050 pokev+16,int(x/255)
1060 pokev,x-int(x/255)*255
1070 pokev+1,y
1080 z=cc+40*rc:ifpeek(g+z)=81thensc=sc+n:pokeh+z,6
1090 return
1500 forj=0 to 24:poke s+j,0:next:return
2000 data0,168,0,2,170,0,10,186,128
2010 data170,170,168,153,185,152,170,170,168
2020 data34,186,32,170,170,168,153,185,152
2030 data170,170,168,10,186,128,2,170,0,0,168,0
Il file .PRG del listato
Provalo direttamente sull’emulatore! Clicca sul pulsante per avviare!
Downloading…