Camelot – TI99/4A – TI-Basic

Rivista: Paper Soft – Numero: 1 – Anno 1984 – Trascrizione: Ermanno Betori

Dopo aver recentemente pubblicato due listati Basic per il Commodore 64, Giant’s Gold e C64 Clock ed uno per Dragon32/64, Valley of Death, é arrivato il momento di dare spazio ad un computer che li ha preceduti entrambi, il TI99/4A della Texas Instruments.

Il listato che andiamo a presentarvi é un simpatico gioco scritto in TI-Basic con tanto di grafica ridefinita, ottenuta tramite la redefinizione dei caratteri ASCII standard.

Il listato originale di Camelot e’ stato pubblicato sulla rivista Paper Soft numero 1 del 1984, edita da JSoft.

Titolo: Challenge of Camelot
Piattaforma: TI 99/4A
Linguaggio: TI-Basic
Versione originale: 99’ER Version 2.11.1
Pubblicazione: PaperSoft 1 – 1984
Anno: 1984
Trascrizione: Ermanno Betori
Anno: 2021
Download: Camelot.dsk
Note: Simulazione del classico gioco carta, sasso, forbice…

Istruzioni
Come nel gioco carta, sasso, forbice, in questo gioco dobbiamo affrontare una serie di cavalieri in una giostra medievale, scegliendo di volta in volta l’arma da utilizzare nella tenzone.
Al posto dei canonici carta, sasso, forbice, dovremo utilizzare:
L – Lancia
S – Spada
M – Mazza
– Lancia batte Spada
– Mazza batte Lancia
– Spada batte Mazza

Qui di seguito trovate il codice da copiare sul vostro TI99/4A oppure su un emulatore, noi suggeriamo Classic99

Di seguito le istruzioni per caricare il listato sull’emulatore Classic99:
– Copiare il listato di cui sotto
– Avviare l’emulatore e premere un tasto qualsiasi
– Dopodiché premere 1 per avviare il TI Basic
– Dal comando Edit, selezionare Paste (Ctrl+F1) per incollare il listato
– Digitare RUN per eseguire il codice
– Buon divertimento!!!

Attenzione – Ci siamo resi conto che nel listato i caratteri ‘>’ e ‘<‘ potrebbero venir sostituiti dai rispettivi encoding html ‘&gt’ e ‘&lt’. Nel caso, sostituite questi valori nel listato prima di copiarlo sull’emulatore.

Listato:  Camelot – Ti99/4A – TI-Basic


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
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
130 REM   ** CAMELOT **
140 REM  BY GARY GARRETT
150 REM  99'ER VERSION 2.11.1    
160 CALL CLEAR
170 GOSUB 4440
180 GOSUB 4490
190 CALL CLEAR
200 GOTO 250
210 RESTORE 4700
220 R=10
230 GOSUB 4610
240 RETURN
250 INPUT "NAME PLEASE:":O$
260 INPUT "INSTRUCTIONS? (Y/N) ":A$
270 IF A$="Y" THEN 3680 ELSE 1460
280 CALL CLEAR
290 G=2
300 CALL SCREEN(8)
310 PRINT " CHALLENGE OF CAMELOT ": : : : : : : : : : : : : : :
320 PRINT O$," THE DRAGON": : : : : : : :
330 DATA 6,5,7,10,4,21,6,27
340 DATA 10,1,9,2,10,15,9,16,8,17,7,18,10,1,1,1
350 DATA 10,14,7,25,9,31,10,32,10,1
360 RESTORE 4720
370 R=11
380 GOSUB 4610
390 CALL COLOR(9,16,1)
400 CALL COLOR(14,2,1)
410 CALL COLOR(10,5,16)
420 CALL COLOR(11,5,8)
430 DATA 3,3,4,9,5,14,3,17,3,27,3,3
440 GOSUB 1140
450 RESTORE 330
460 FOR I=1 TO 4
470 READ X,Y
480 CALL HCHAR(X,Y,101)
490 CALL HCHAR(X,Y+1,102)
500 CALL HCHAR(X+1,Y-1,101)
510 CALL HCHAR(X+1,Y,103,2)
520 CALL HCHAR(X+1,Y+2,102)
530 CALL HCHAR(X+2,Y-1,104)
540 CALL HCHAR(X+2,Y,105,2)
550 CALL HCHAR(X+2,Y+2,106)
560 CALL HCHAR(X+2,Y-2,112)
570 CALL HCHAR(X+2,Y+3,113)
580 CALL VCHAR(X+3,Y-2,114,12-(X+3))
590 CALL VCHAR(X+3,Y-1,114,12-(X+3))
600 CALL VCHAR(X+3,Y,114,12-(X+3))
610 CALL VCHAR(X+3,Y+1,114,12-(X+3))
620 CALL VCHAR(X+3,Y+2,114,12-(X+3))
630 CALL VCHAR(X+3,Y+3,114,12-(X+3))
640 NEXT I
650 RESTORE 340
660 FOR I=1 TO 6
670 READ X,Y
680 CALL HCHAR(X,Y,112)
690 CALL VCHAR(X+1,Y,114,12-(X+1))
700 NEXT I
710 RESTORE 350
720 FOR I=1 TO 4
730 READ X,Y
740 CALL HCHAR(X,Y,113)
750 CALL VCHAR(X+1,Y,114,12-(X+1))
760 NEXT I
770 CALL HCHAR(9,8,107)
780 CALL HCHAR(8,25,107)
790 RESTORE 430
800 FOR F=1 TO 5
810 GOSUB 1180
820 NEXT F
830 RESTORE 1870
840 FOR I=1 TO 4
850 READ X
860 Y=8
870 GOSUB 1260
880 NEXT I
890 RESTORE 4830
900 R=8
910 GOSUB 4610
920 RESTORE 1870
930 FOR I=1 TO 4
940 READ A
950 B=25
960 GOSUB 990
970 NEXT I
980 GOTO 2170
990 CALL COLOR(12,13,1)
1000 CALL HCHAR(A,B+3,32,3)
1010 CALL HCHAR(A+1,B+3,32,3)
1020 CALL HCHAR(A,B-1,120)
1030 CALL SOUND(9,-1,9)
1040 CALL HCHAR(A,B,121)
1050 CALL HCHAR(A,B+1,32)
1060 CALL HCHAR(A,B+2,122)
1070 CALL HCHAR(A+1,B-1,123)
1080 CALL HCHAR(A+1,B,124)
1090 CALL HCHAR(A+1,B+1,125)
1100 CALL SOUND(9,-2,9)
1110 CALL HCHAR(A+1,B+2,126)
1120 CALL HCHAR(A+1,B+3,127)
1130 RETURN
1140 RESTORE 4750
1150 R=4
1160 GOSUB 4610
1170 RETURN
1180 READ X,Y
1190 CALL HCHAR(X,Y,99)
1200 CALL HCHAR(X,Y+1,100)
1210 CALL HCHAR(X+1,Y-2,97)
1220 CALL HCHAR(X+1,Y-1,99)
1230 CALL HCHAR(X+1,Y,98,2)
1240 CALL HCHAR(X+1,Y+2,100)
1250 RETURN
1260 CALL HCHAR(X,Y-3,32,2)
1270 CALL HCHAR(X+1,Y-3,142,2)
1280 CALL HCHAR(X,Y-1,131)
1290 CALL SOUND(8,-2,9)
1300 CALL HCHAR(X,Y,132)
1310 CALL SOUND(8,-3,9)
1320 CALL HCHAR(X,Y+1,133)
1330 CALL HCHAR(X+1,Y-1,141)
1340 CALL HCHAR(X+1,Y,140)
1350 CALL HCHAR(X+1,Y+1,143)
1360 RETURN
1370 CALL HCHAR(A,B+2,32,2)
1380 CALL COLOR(4,5,1)
1390 CALL HCHAR(A,B-1,58)
1400 CALL SOUND(8,-1,9)
1410 CALL HCHAR(A,B,59)
1420 CALL SOUND(8,-2,9)
1430 CALL HCHAR(A,B+1,60)
1440 CALL HCHAR(A+1,B-1,142,5)
1450 RETURN
1460 G=1
1470 CALL CLEAR
1480 CALL SCREEN(8)
1490 PRINT O$;",":"PLEASE WAIT WHILE I MEASURE YOU FOR YOUR SUIT OF ARMOUR": : :
1500 RESTORE 4760
1510 R=7
1520 GOSUB 4610
1530 PRINT "IT LOOKS LIKE YOU WEAR AN   OFF THE RACK SIZE": : : :
1540 FOR I=1 TO 300
1550 NEXT I
1560 DATA 9,4,7,7,7,9,5,12,5,15,4,17,5,19,5,22,7,25,7,27,9,30,17,15,16,17,17,19
1570 PRINT " CHALLENGE OF CAMELOT": : : : : : : : : : : : : : :O$,"       SIR 99": : : : : : : :
1580 CALL COLOR(9,16,1)
1590 CALL COLOR(10,9,16)
1600 CALL COLOR(13,2,1)
1610 CALL COLOR(14,2,12)
1620 CALL HCHAR(11,1,106,32)
1630 DATA 4,7,3,25,4,29
1640 GOSUB 1140
1650 RESTORE 1560
1660 FOR I=1 TO 14
1670 READ X,Y
1680 CALL HCHAR(X,Y,101)
1690 CALL HCHAR(X+1,Y-1,102)
1700 CALL HCHAR(X+1,Y,103)
1710 CALL HCHAR(X+2,Y-1,104,2)
1720 CALL HCHAR(X+3,Y-1,105,2)
1730 CALL HCHAR(X+4,Y-1,105,2)
1740 IF(10<Y)*(Y<23)THEN 1750 ELSE 1780
1750 CALL HCHAR(X+5,Y-1,105,2)
1760 CALL HCHAR(X+6,Y-1,105,2)
1770 CALL HCHAR(X+4,Y-1,104,2)
1780 CALL HCHAR(11,5,106,24)
1790 NEXT I
1800 CALL HCHAR(14,1,106,32)
1810 CALL HCHAR(13,5,142,24)
1820 RESTORE 1630
1830 FOR F=1 TO 3
1840 GOSUB 1180
1850 NEXT F
1860 GOSUB 210
1870 DATA 12,18,20,22
1880 RESTORE 1870
1890 FOR I=1 TO 4
1900 READ X
1910 Y=8
1920 GOSUB 1260
1930 NEXT I
1940 RESTORE 1870
1950 FOR I=1 TO 4
1960 READ A
1970 B=25
1980 GOSUB 1370
1990 NEXT I
2000 GOSUB 4490
2010 GOTO 2170
2020 DATA 10,23,12,21,14,19,16,17
2030 RESTORE 2020
2040 FOR F=1 TO 4
2050 READ Y,B
2060 X=12
2070 A=12
2080 IF G=1 THEN 2110
2090 GOSUB 990
2100 GOTO 2120
2110 GOSUB 1370
2120 GOSUB 1260
2130 NEXT F
2140 CALL SOUND(200,1000,0,3250,0,6750,0)
2150 CALL SOUND(200,1000,15,3250,15,6750,15)
2160 GOTO 2500
2170 M=4
2180 N=4
2190 X=12
2200 A=12
2210 GOSUB 210
2220 RANDOMIZE
2230 C=INT(RND*3)+1
2240 ON C GOTO 2250,2270,2290
2250 W$="LANCE "
2260 GOTO 2300
2270 W$="MACE"
2280 GOTO 2300
2290 W$="SWORD "
2300 DATA 67,72,79,79,83,69,32,32,32,76,32,77,32,83
2310 RESTORE 2300
2320 FOR A=3 TO 16
2330 READ B
2340 CALL HCHAR(24,A,B)
2350 NEXT A
2360 GOSUB 4560
2370 CALL KEY(0,A,B)
2380 IF B=0 THEN 2370
2390 A$=CHR$(A)
2400 CALL HCHAR(24,1,32,32)
2410 CALL HCHAR(15,1,32,32)
2420 P=POS("LMS",A$,1)
2430 IF P>0 THEN 2450
2440 GOTO 2310
2450 FOR A=18 TO 23
2460 CALL HCHAR(A,4,32,6)
2470 CALL HCHAR(A,23,32,8)
2480 NEXT A
2490 ON G GOTO 2020,3980
2500 IF C=P THEN 2920
2510 IF C+P=4 THEN 2870
2520 IF P<=C THEN 2540
2530 ON G GOTO 2700,4110
2540 IF G=2 THEN 4190
2550 RESTORE 4780
2560 R=7
2570 GOSUB 4610
2580 DATA 18,15,20,13,22,11,24,9,26,7,28,5
2590 RESTORE 2580
2600 A=12
2610 X=12
2620 FOR I=1 TO 5
2630 READ Y,B
2640 GOSUB 1370
2650 GOSUB 1260
2660 NEXT I
2670 N=N-1
2680 P$="I WON, I USED A "
2690 GOTO 3100
2700 M=M-1
2710 RESTORE 4800
2720 R=3
2730 GOSUB 4610
2740 P$="YOU WON, I USED A "
2750 X=12
2760 Y=16
2770 GOSUB 1260
2780 RESTORE 2580
2790 FOR I=1 TO 5
2800 READ Y,B
2810 X=12
2820 A=12
2830 GOSUB 1370
2840 GOSUB 1260
2850 NEXT I
2860 GOTO 3100
2870 ON G GOTO 2900,2880
2880 IF P>C THEN 4190
2890 GOTO 4110
2900 IF P>C THEN 2550
2910 GOTO 2700
2920 P$="NO ONE WON, I USED A "
2930 ON G GOTO 2750,3760
2940 FOR I=1 TO 400
2950 NEXT I
2960 ON G GOTO 2970,3050
2970 CALL HCHAR(3,1,32,416)
2980 CALL HCHAR(16,1,32,16)
2990 CALL HCHAR(16,19,32,14)
3000 PRINT:"YOU HAVE WON IN THE JOUST, ":"AND AS THE MIGHTIEST KNIGHT":"YOU MUST DEFEND OUR FAIR "
3010 PRINT "CAMELOT FROM THE DEMON ":"DRAGON. GOOD LUCK": : : :
3020 GOSUB 4490
3030 INPUT "PRESS ENTER TO CONTINUE":A$
3040 GOTO 280
3050 PRINT "SIR ";O$:"YOU HAVE EARNED THE HIGHEST":"HONORS FOR YOUR VALOR":"THEREFORE"
3060 PRINT:"I WELCOME THEE TO THE ":"ROUND TABLE": : :
3070 GOSUB 4440
3080 GOSUB 4440
3090 GOTO 3510
3100 M$=P$&W$
3110 X=15
3120 Y=3
3130 GOSUB 4660
3140 IF N=0 THEN 3290
3150 IF M=0 THEN 2940
3160 IF N=1 THEN 3320
3170 X=18
3180 Y=8
3190 GOSUB 1260
3200 IF N=2 THEN 3320
3210 X=20
3220 Y=8
3230 GOSUB 1260
3240 IF N=3 THEN 3320
3250 X=22
3260 Y=8
3270 GOSUB 1260
3280 GOTO 3320
3290 FOR I=1 TO 700
3300 NEXT I
3310 GOTO 3510
3320 IF M=1 THEN 3440
3330 A=18
3340 B=25
3350 ON G GOSUB 1370,990
3360 IF M=2 THEN 3440
3370 A=20
3380 B=25
3390 ON G GOSUB 1370,990
3400 IF M=3 THEN 3440
3410 A=22
3420 B=25
3430 ON G GOSUB 1370,990
3440 X=12
3450 Y=8
3460 A=12
3470 B=25
3480 GOSUB 1260
3490 ON G GOSUB 1370,990
3500 GOTO 2210
3510 M$="PLAY AGAIN? (Y/N)"
3520 X=24
3530 Y=7
3540 GOSUB 4660
3550 CALL KEY(0,A,B)
3560 IF B=0 THEN 3550
3570 IF A=78 THEN 3640
3580 CALL HCHAR(24,1,32,32)
3590 GOSUB 4490
3600 N=4
3610 M=4
3620 IF G=2 THEN 1460
3630 GOTO 3140
3640 CALL CLEAR
3650 PRINT O$;",":"THANK YOU FOR PLAYING"
3660 GOSUB 4490
3670 END
3680 CALL CLEAR
3690 PRINT "YOU HAVE 4 KNIGHTS TO ENTER ": :"A JOUST TO DETERMINE IF YOU ": :"ARE WORTHY OF DEFENDING": :
3700 PRINT "CAMELOT FROM 4 DEMON DRAGONS": :"YOU HAVE CHOICE OF 3 WEAPONS": :"LANCE, MACE AND SWORD": : :
3710 PRINT "LANCE BEATS SWORD": :"MACE BEATS LANCE": :"SWORD BEATS MACE": : :
3720 GOSUB 4490
3730 INPUT "PRESS ENTER TO START":A$
3740 GOSUB 4560
3750 GOTO 1460
3760 CALL COLOR(12,10,1)
3770 CALL COLOR(12,3,1)
3780 RANDOMIZE
3790 F=INT(RND*2)+1
3800 ON F GOTO 3810,3960
3810 CALL SOUND(-99,-5,1)
3820 CALL COLOR(13,16,10)
3830 CALL COLOR(14,16,10)
3840 CALL COLOR(13,16,1)
3850 CALL COLOR(14,16,1)
3860 CALL COLOR(13,12,1)
3870 CALL COLOR(14,12,1)
3880 CALL COLOR(13,2,1)
3890 CALL COLOR(14,2,1)
3900 CALL SOUND(150,-6,0)
3910 FOR I=0 TO 30 STEP 5
3920 CALL SOUND(150,-7,I)
3930 NEXT I
3940 M$=" YOUR SHIELD WAS SCORCHED "
3950 GOTO 4320
3960 M$="YOU HAVE INJURED THE DRAGON"
3970 GOTO 4320
3980 DATA 10,23,12,21,14,19,15,18
3990 RESTORE 3980
4000 FOR F=1 TO 4
4010 READ Y,B
4020 X=12
4030 A=12
4040 GOSUB 990
4050 GOSUB 1260
4060 NEXT F
4070 FOR I=0 TO 30 STEP 15
4080 CALL SOUND(200,1000,I,3250,I,6750,I)
4090 NEXT I
4100 GOTO 2500
4110 CALL COLOR(12,10,1)
4120 CALL COLOR(12,3,1)
4130 RESTORE 4810
4140 R=8
4150 GOSUB 4610
4160 M$=" YOU DEFEATED THIS DRAGON"
4170 M=M-1
4180 GOTO 4320
4190 CALL SOUND(-99,-5,1)
4200 RESTORE 4850
4210 FOR I=1 TO 4
4220 READ A,B
4230 CALL COLOR(13,A,B)
4240 CALL COLOR(14,A,B)
4250 NEXT I
4260 CALL SOUND(150,-6,0)
4270 FOR I=0 TO 30 STEP 5
4280 CALL SOUND(150,-7,I)
4290 NEXT I
4300 M$=" YOUR KNIGHT WAS SCORCHED"
4310 N=N-1
4320 X=15
4330 Y=2
4340 GOSUB 4660
4350 CALL HCHAR(12,1,32,128)
4360 CALL COLOR(13,2,1)
4370 CALL COLOR(14,2,1)
4380 RESTORE 4830
4390 R=8
4400 GOSUB 4610
4410 GOTO 3140
4420 DATA 262,262,523,523,523,523,466,466,440
4430 DATA 262,330,392,523,330,392,523,659,392,523,659,784,523,659,784,1046,1046
4440 RESTORE 4430
4450 FOR I=1 TO 17
4460 READ F
4470 CALL SOUND(100,F,12)
4480 NEXT I
4490 RESTORE 4420
4500 FOR I=1 TO 9
4510 READ A
4520 CALL SOUND(200,A,19)
4530 NEXT I
4540 CALL SOUND(1600,440,20,175,20)
4550 RETURN
4560 FOR I=1 TO 3
4570 CALL SOUND(100,262,15,1047,15)
4580 CALL SOUND(300,392,15,1568,15)
4590 NEXT I
4600 RETURN
4610 FOR U=1 TO R
4620 READ A,A$
4630 CALL CHAR(A,A$)
4640 NEXT U
4650 RETURN
4660 FOR I=1 TO LEN(M$)
4670 CALL HCHAR(X,Y+I,ASC(SEG$(M$,I,1)))
4680 NEXT I
4690 RETURN
4700 DATA 131,000000000100314F,132,40E0E1F9AFFBAFAF,133,000000E0FFE08000,58,00000007FF070100
4710 DATA 59,0207879FF5BFF5F5,60,000000008000ECEF,140,DEFE2F33010A0400,141,8F1F1E1834428100,142,0
4720 DATA 143,00000080402010,101,01030B0F1F3FBFFF,102,80C0C0E0F8F8FDFF,103,FFFFFFFFFFFFFFFF,104,10A262CC981135FD
4730 DATA 105,089A92B998D9B1F5,106,301596DBD98CD69F,107,FEFCF5FFAE6DD3F7F,112,01030B0F1F3FBFFF
4740 DATA 113,80C0C0E0F8F8FDFF,114,FFFFFFFFFFFFFFFF
4750 DATA 97,0000000C0E1E3FFF,98,FFFFFFFFFEFFFEF6,99,030F2777FFFFFF7F,100,60F0C8D0A040789F
4760 DATA 142,0,101,80E0F0FACD848080,102,00010103070F3FFF,103,80808040A0508CFF
4770 DATA 104,44EE776666666666,105,6666666666666666,106,FFCC3333CCCC33FF
4780 DATA 131,393B94DA3D06334F,132,030CB1C1416BA7F7,133,000000E0E08,140,E6FE2F31010A04
4790 DATA 131,000000000001314F,132,00000101010B0777,140,06FE1F03010A04
4800 DATA 58,0000000707070100,59,0000808080D0F0FF,60,000000008000ECF3
4810 DATA 120,0,121,0,122,0,123,040201000033059FF,124,000001875F3FEFDF,125,0070FCFFFFEFEFDF
4820 DATA 126,00000000C0F0FEFF,127,0000000007030DF0
4830 DATA 120,00000030D8FC0F07,121,000000008090B2F6,122,0038182840402010,123,0303030A14,124,FEFFFFFFFF77073F
4840 DATA 125,C0D0F8F8FCFFFFC7,126,0C020101021CF0C,127,00
4850 DATA 16,10,16,1,12,1,1,1

Share

Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *

Questo sito usa Akismet per ridurre lo spam. Scopri come i tuoi dati vengono elaborati.