Código de Basic - Programas C64

Imágen de perfil
Val: 545
Oro
Ha mantenido su posición en Basic (en relación al último mes)
Gráfica de Basic

Programas C64gráfica de visualizaciones


Basic

Actualizado el 28 de Diciembre del 2025 por Adelino (28 códigos) (Publicado el 2 de Julio del 2021)
10.043 visualizaciones desde el 2 de Julio del 2021
Recopilacion de 3 programas para commodore 64 en disco D64.

sudoku
muro
tetris

Requerimientos

Se manejan con el teclado.

1.0

Publicado el 2 de Julio del 2021gráfica de visualizaciones de la versión: 1.0
6.218 visualizaciones desde el 2 de Julio del 2021

1.1

Publicado el 20 de Diciembre del 2025gráfica de visualizaciones de la versión: 1.1
3.303 visualizaciones desde el 20 de Diciembre del 2025

1.2

Publicado el 28 de Diciembre del 2025gráfica de visualizaciones de la versión: 1.2
523 visualizaciones desde el 28 de Diciembre del 2025
estrellaestrellaestrellaestrellaestrella
estrellaestrellaestrellaestrella
estrellaestrellaestrella
estrellaestrella
estrella

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
TETRIS
------
 
10 poke 53280,0: poke 53281,0
20 print chr$(147)
30 dim A(2,7,3,3),C(7,3,3)
40 dim D(279),H(279),Q(279)
50 dim E(255),B(27),Y(27)
60 G(0)=1: G(1)=2: G(2)=3
70 X(0)=10: X(1)=1: X(2)=-1
80 E(29)=1: E(17)=2: E(32)=3
90 c=10: q=55200
 
100 rem **** Pantalla ****
110 for y=1 to 27
120 a=11: B(y)=c
130 n=n+10: q=q+30
140 if y>2 then poke q+10,11:               poke q-54262,207
150 for x=0 to 9
160 if y<3 then Q(c)=2
170 if y>2 then Q(c)=q: poke q,a:           poke q-54272,207
180 if a then D(c)=a: if y<27 then a=0
190 H(c)=y: c=c+1: q=q+1
200 next x,y
210 for g=0 to 3: c=g<1
220 for a=1 to 7: n=0
230 for y=-c to c+3
240 for x=0 to 3
250 if c then read q
260 if g then q=A(g-1,a,y,x)
270 if q then C(a,g,n)=x+B(y): n=n+1:       if q>g then A(g,a,x,3-y)=3
280 next x,y,a,g
290 p=int(rnd(0)*7)+1
 
300 rem *** Inicio ***
310 for n=0 to 3
320 c=C(p,0,n)+14
350 if D(c) goto 350
360 poke Q(c),p: poke Q(n),0
370 V(n)=c: D(c)=-1
380 next
390 a=p: c=14: g=0
400 p=int(rnd(0)*7)+1
410 for n=0 to 3
420 Q(n)=Q(C(p,0,n)+80)+176
430 poke Q(n),p: poke Q(n)-54272,207
440 next
 
500 rem **** Rutina ****
510 get e$: if e$<>"" then n=asc(e$):       goto 500
520 x=X(E(n)): y=g: if x=0 then g=G(y)
540 c=c+x: n=0
550 W(n)=c+C(a,g,n)
560 if D(W(n))>0 goto 700
570 if n<3 then n=n+1: goto 550
580 for n=0 to 3
590 y=W(n): if D(y)=0 then poke Q(y),a
600 D(y)=D(y)-1
610 next
620 for n=0 to 3
630 y=V(n): D(y)=D(y)+1
640 if D(y)=0 then poke Q(y),0
650 V(n)=W(n)
660 next
670 goto 500
 
700 rem **** Lineas ****
710 if x<10 then c=c-x: g=y: goto 500
720 for n=0 to 3
730 y=H(V(n))
740 if Y(y)<8 then Y(y)=Y(y)+1:             D(V(n))=a: goto 850
750 for c=B(y)+1 to B(y)+9
760 D(c)=D(c-10)
770 poke Q(c),D(c)
780 next
790 Y(y)=Y(y-1): y=y-1
800 if Y(y) goto 750
850 next
860 goto 300
 
900 rem **** Piezas ****
910 data 0,0,0,0,1,1,1,1
920 data 0,1,0,0,0,1,1,1
930 data 0,0,1,0,1,1,1,0
940 data 0,1,1,0,0,0,1,1
950 data 0,1,1,0,1,1,0,0
960 data 0,1,0,0,1,1,1,0
970 data 0,1,1,0,0,1,1,0
 
 
 
               MURO
              ------
 
10 poke 53280,0: poke 53281,0
20 print chr$(147)
30 dim A(559)
40 a=55296: d=54272: h=248
50 c=a: b=a+940: n=a+159
 
100 rem **** Pantalla ****
110 for y=0 to 8: n=n+2: e=e=0
120 for x=1 to e+20
130 g=e<0 or x>1 and x<20
140 for p=0 to -g
150 poke n,h: poke n-d,40*p+207
160 A(n-a)=n-g-p-p: n=n+1
170 next p,x,y
180 for n=a to a+39
190 poke n,11: poke n-d,207
200 poke n+960,0: poke n+960-d,249
210 next
220 for y=1 to 23: c=c+40
230 poke c,11: poke c-d,207
240 poke c+39,11: poke c+39-d,207
250 next
260 c=b+40: g=20: p=246
270 x=-1: y=-40
 
300 rem **** Rutina ****
310 poke b,0: b=b+y+x
320 poke b,5: poke b-d,81
330 gosub 600
340 g=g+x: n=b-a: if n<80 then y=40
350 t=-1: if g=1 or g=38 then x=-x: t=1
360 if peek(b+x)=h then poke b+x,0:         poke A(n+x),0: x=-x
370 if peek(b+y)=h then poke b+y,0:         poke A(n+y),0: y=-y
380 if peek(b+y+x)=h then poke b+y+x,0:     poke A(n+y+x),0: y=-y: x=x*t
390 gosub 600
400 if n<920 goto 300
 
500 rem **** Rebote ****
510 n=peek(b+y)=p or peek(b+y+x)=p
520 if n=0 then gosub 600: goto 500
530 x=(c<b+38)*t-(c>b+39)*t: y=-40
540 goto 300
 
600 rem **** Teclado ****
610 get e$: if e$<>"" then e=asc(e$):       goto 600
620 if e=29 and c<a+996 then poke c,0:      poke c+4,p: c=c+1
630 if e=17 and c>a+960 then c=c-1:         poke c,p: poke c+4,0
640 e=0: return
 
 
 
               SUDOKU
              --------
 
10 poke 53280,0: poke 53281,0
20 print chr$(151) chr$(147)
30 dim A(300),K(255),B(2)
40 dim C(80),Q(80),X(80),Y(80),Z(80)
50 K(32)=32: K(46)=32: K(48)=32
60 for v=49 to 57: K(v)=v
70 next
80 b=1133
 
100 rem **** Pantalla ****
110 for v=0 to 2
120 for x=0 to 2: read a$: b=b+62
130 for y=0 to 2
140 for z=0 to 2
150 X(a)=27*v+9*x
160 Y(a)=27*y+9*z+81
170 Z(a)=27*v+9*y+162
190 poke b,K(asc(mid$(a$,3*y+z+1)))
200 poke b-1,66: poke b+1,66
210 poke b-40,67: poke b+40,67
220 poke b+41,91: poke b+54272,15
230 if v+x=0 then poke b-39,114
240 if v+x=4 then poke b+41,113
250 if y+z=0 then poke b+39,107
260 if y+z=4 then poke b+41,115
270 Q(a)=b: a=a+1: b=b+2
280 next z,y,x,v
290 poke 1154,112: poke 1172,110
300 poke b+21,109: poke b+39,125
 
400 rem **** Teclado ****
410 if e=29 and c<80 then c=c+1
420 if e=157 and c>0 then c=c-1
430 if e=17 and c<72 then c=c+9
440 if e=145 and c>8 then c=c-9
450 if K(e) then poke Q(c),K(e): e=29:      goto 400
460 poke Q(c),peek(Q(c))+128
470 get e$: if e$="" goto 470
480 poke Q(c),peek(Q(c))-128
490 e=asc(e$): if e<>13 goto 400
 
500 rem **** Validar ****
510 for c=0 to 80
520 a=peek(Q(c))
530 x=X(c)+a: y=Y(c)+a: z=Z(c)+a
540 if A(x)+A(y)+A(z) then a=32
550 if a=32 then poke Q(c),48: goto 590
560 A(x)=1: A(y)=1: A(z)=1
570 poke Q(c)+54272,30
580 B(c/27)=B(c/27)+1
590 next
 
600 rem **** Grupos ****
610 for x=0 to 2: y=0
620 if B(1)>B(y) then y=1
630 if B(2)>B(y) then y=2
640 B(y)=-1: z=27*y
650 for c=z to z+26
660 if peek(Q(c))=48 then C(n)=c: n=n+1
670 next c,x
680 b=sgn(n)
 
700 rem **** Rutina ****
710 if b=0 then end
720 b=b-1
730 c=C(b)
740 a=peek(Q(c))
750 x=X(c)+a: y=Y(c)+a: z=Z(c)+a
760 if a>48 then A(x)=0: A(y)=0: A(z)=0
800 if a=57 then poke Q(c),48: goto 710
810 a=a+1: x=x+1: y=y+1: z=z+1
820 if A(x)+A(y)+A(z) goto 800
830 A(x)=1: A(y)=1: A(z)=1
840 poke Q(c),a
850 b=b+1: if b<n goto 730
860 get e$: if e$<>" " goto 860
870 goto 720
 
900 rem **** Ejemplo ****
910 data ....76...
920 data 1...3874.
930 data .7.......
940 data ..4.6.5.1
950 data .67...28.
960 data 3.1.4.6..
970 data .......1.
980 data .2561...9
990 data ...98....



Comentarios sobre la versión: 1.2 (0)


No hay comentarios
 

Comentar la versión: 1.2

Nombre
Correo (no se visualiza en la web)
Valoración
Comentarios...
CerrarCerrar
CerrarCerrar
Cerrar

Tienes que ser un usuario registrado para poder insertar imágenes, archivos y/o videos.

Puedes registrarte o validarte desde aquí.

Codigo
Negrita
Subrayado
Tachado
Cursiva
Insertar enlace
Imagen externa
Emoticon
Tabular
Centrar
Titulo
Linea
Disminuir
Aumentar
Vista preliminar
sonreir
dientes
lengua
guiño
enfadado
confundido
llorar
avergonzado
sorprendido
triste
sol
estrella
jarra
camara
taza de cafe
email
beso
bombilla
amor
mal
bien
Es necesario revisar y aceptar las políticas de privacidad

http://lwp-l.com/s7115