BRICK en BASIC para NewBrain
Publicado: 10 May 2011 19:29
Añado un fichero que podéis descargar BRICKNB.RAR
Incluye el programa BRICK tanto en formato NewBrain como en TXT.
bricknb.rar
Incluye el programa BRICK tanto en formato NewBrain como en TXT.
Código: Seleccionar todo
5 REM Brick 1984 Simon Murphy published in NBUG4 170884
10 OPEN#0,0:CLOSE#16:OPEN#16,6
20 ?"Instructions"
30 ?:?"Press the space bar to fire the ball";"at the wall. The bricks will eithe
r";"fall, or get loose (change colour).";
35 ?"Time and score displayed at the bottom";"of the screen."
40 GET#16,a:IFa<>13THEN40
100 OPEN#0,0
110 PUT31
120 sc=0:ti=1000:r=2
130 FORx=1TO40
135 FORy=1TO7
136 PUT22,x,y,147
137 NEXTy
138 NEXTx
140 REM do until routine
150 y=21:x=0
160 IFr=-2THENx=40:GOTO175
170 IFr=2THENx=0:GOTO175
171 GOTO180
175 GOSUB500
180 ti=ti-3:y=21
190 x=x+r:PUT22,x,22,153,8,32
200 IFx=40ORx=0THEN r=-r:ti=ti-3:GOSUB500
210 IFsc<0THENsc=0
220 IFti<0THENti=0:?"** Game over **":?"** Score=";sc;"**":END
230 GET#16,k:IFk=32GOSUB250:r=-r:GOTO150
240 GOTO190:REM until
250 x=x+INT(RND*2):ti=ti-3
260 x=x+r/2:y=y-2:PUT22,x,y,20 :GET#0,s:IFs=147ORs=94GOSUB330 :RETURN
270 IFs=146THENRET
280 PUT22,x,y,153,8,32
290 IFy=1THENPUT22,x,y,94:sc=sc+1:RET
300 IFx<2ORx>38THEN RET
310 IFy<10THENy=y+1
320 GOTO260
330 IFs=147THENPUT22,x,y+1,20:GET#0,t
340 IFs=94THENsc=sc-1:GOSUB380:RET
350 IFt=147THENPUT22,x,y,146:GOTO370
360 PUT22,x,y,128:FORz=yTO22:PUT22,x,z,147,22,x,z,128:NEXTz:GOSUB380
370 RETURN
380 y=y-1:PUT22,x,y,20:GET#0,z:IFz=146ORz=94THENFORe=yTO22:PUT22,x,e,146,22,x,e,
128:NEXTe:IFy<>0THEN380
390 x=0
400 RETURN
500 PUT22,1,23:?"Score=";sc;" time=";ti:RETURN
bricknb.rar