-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathA12_Verkeer.bc2
373 lines (372 loc) · 10.8 KB
/
A12_Verkeer.bc2
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
1000 A=200:GOTO20:REM VERKEER
1010 GOTO3810
1020 K=0
1030 REM PAUZE ROUTINE
1040 XT=350*ABS(XT):IFXT=0 THENXT=.1
1050 FORI=1 TOXT:NEXTI
1060 XT=0:RETURN
1070 REM WISROUTINE
1080 VE=14:HO=0:GOSUB110:PRINTE$:PRINTE$
1090 VE=13:HO=15:GOSUB110:PRINTE$:GOSUB110
1100 RETURN
1110 REM VOORRANGSREGELS
1120 GOSUB20000
1130 GOSUB1150:GOSUB1190:GOSUB1240
1140 GOTO1290
1150 GOSUB1070
1160 PRINT"REGEL 1"
1170 PRINT"(RIJ-)VERKEER VAN RECHTS GAAT":PRINT"VOOR."
1180 XT=9:GOSUB1030:RETURN
1190 GOSUB1070
1200 PRINT"REGEL 2"
1210 PRINT"SNELVERKEER GAAT VOOR LANGZAAM "
1220 PRINT"VERKEER."
1230 XT=9:GOSUB1030:RETURN
1240 GOSUB1070
1250 PRINT"REGEL 3"
1260 PRINT"RECHTDOOR OP DEZELFDE WEG GAAT "
1270 PRINT"VOOR. "
1280 XT=9:GOSUB1030:RETURN
1290 GOSUB1070:GOSUB20000
1300 VE=14:HO=0:GOSUB110
1310 PRINT"ELKE VOLGENDE REGEL MAAKT DE "
1320 PRINT"VORIGE ONGELDIG !"
1330 XT=9:GOSUB1030
1340 GOSUB1070
1350 PRINT"1 HERHAAL REGELS"
1360 PRINT"2 VOORBEELDEN"
1370 PRINT"3 OEFENINGEN"
1380 REM VOORBEELDEN
1390 GOSUB210:IFIN$="1" THEN1110
1400 IFIN$="3" THENRETURN
1410 IFIN$<>"2" THEN3060
1420 REM VOORBEELDEN
1430 GOSUB20000:HO=0:VE=16
1440 GOSUB110:R1=1:R2=3
1450 GOSUB260:F1=INT(RV*2)+1:F2=F1:F3=4
1460 GOSUB3540:GOSUB2230:GOSUB2590
1470 GOSUB20000
1480 VE=14:HO=0:GOSUB110
1490 PRINT"NUMMER 2 HEEFT VOORRANG"
1500 PRINT"VOLGENS VOORRANGSREGEL 1."
1510 XT=9:GOSUB1030:GOSUB1070
1520 GOSUB1150
1530 F1=1:F2=2:R1=1:R2=3
1540 GOSUB3540:GOSUB2230:GOSUB2590:GOSUB20000
1550 VE=14:HO=0:GOSUB110
1560 PRINT"NUMMER 1 HEEFT VOORRANG"
1570 PRINT"VOLGENS VOORRANGSREGEL 2."
1580 XT=9:GOSUB1030:GOSUB1070
1590 GOSUB1190
1600 F1=1:F3=1:R1=1:R3=3
1610 GOSUB3540:GOSUB2230:GOSUB2400:GOSUB20000
1620 VE=14:HO=0:GOSUB110
1630 PRINT"NUMMER 1 HEEFT VOORRANG"
1640 PRINT"VOLGENS VOORRANGSREGEL 3."
1650 XT=9:GOSUB1030:GOSUB1070
1660 GOSUB1240
1670 F1=2:F3=1:R1=1:R3=3
1680 GOSUB3540:GOSUB2230:GOSUB2400:GOSUB20000
1690 VE=14:HO=0:GOSUB110
1700 PRINT"NUMMER 1 HEEFT WEER VOORRANG "
1710 PRINT"VOLGENS VOORRANGSREGEL 3. "
1720 XT=9:GOSUB1030:GOSUB1070
1730 GOSUB1240
1740 F1=3:F3=1:R1=1:R3=3
1750 GOSUB3540:GOSUB2230:GOSUB2400:GOSUB20000
1760 VE=14:HO=0:GOSUB110
1770 PRINT"VOETGANGER 1 HEEFT OOK VOORRANG "
1780 PRINT"VOLGENS VOORRANGSREGEL 3. "
1790 XT=9:GOSUB1030:GOSUB1070
1800 GOSUB1240
1810 GOSUB1070:GOSUB20000
1820 HO=0:VE=14:GOSUB110
1830 PRINT"VOORBEELDEN NOG EEN KEER ? (J/N)"
1840 GOSUB210:IF(IN$="J") OR(IN$="j") THEN1420
1850 IF(IN$<>"N") AND(IN$<>"n") THEN1840
1860 REM ONBEPAALDE SITUATIES
1870 GOSUB1070:HO=13:GOSUB110
1880 PRINT:PRINT"ALS VERKEER ELKAAR"
1890 PRINT"NIET KRUIST DAN IS ER GEEN "
1900 PRINT"VOORRANGSSITUATIE (DUS TOETS 0)!"
1910 XT=20:GOSUB1030:GOSUB20000
1920 F1=3:F3=1:R1=1:R3=1
1930 GOSUB3540:GOSUB2230:GOSUB2400
1940 XT=9:GOSUB1030
1950 F2=2:F3=1:R2=2:R3=1
1960 GOSUB3540:GOSUB2590:GOSUB2400
1970 XT=9:GOSUB1030
1980 RETURN
1990 REM SITUATIES
2000 GOSUB20000
2010 F=4:PP=PP+1
2020 GOSUB260:F1=INT(RV*F)+1
2030 IFF1=4 THENF=3
2040 GOSUB260:F2=INT(RV*F)+1
2050 IFF2=4 THENF=3
2060 GOSUB260:F3=INT(RV*F)+1
2070 F=3
2080 GOSUB260:R1=INT(RV*F)+1
2090 GOSUB260:R2=INT(RV*F)+1
2100 GOSUB260:R3=INT(RV*F)+1
2110 IF(K=0) AND(R1=3) THENR1=2
2120 IF(K=0) AND(R2=1) THENR2=2
2130 IF(K=0) AND(R3=2) THENR3=3
2140 IFF1=3 THENR1=1
2150 IFF2=3 THENR2=1
2160 IFF3=3 THENR3=1
2170 IF(F1<4) AND(F2<4) THENF3=4
2180 IFF1=4 THENR1=0
2190 IFF2=4 THENR2=0
2200 IFF3=4 THENR3=0
2210 GOSUB2230:GOSUB2400:GOSUB2590
2220 GOTO2860
2230 REM TEKEN F1
2240 VE=8:HO=0:GOSUB110
2250 IFF1=1 THENPRINT"..A...";:V=0
2260 IFF1=2 THENPRINT"..F...";:V=0
2270 IFF1=3 THENVE=10:GOSUB110
2280 IFF1=3 THENPRINT"..V.";:V=1
2290 REM TEKEN RICHTING R1
2300 IF(R1=1) AND(F1<3) THENPRINT"........"
2310 IF(R1=2) AND(F1<3) THENGOSUB2340
2320 IF(R1=3) AND(F1<3) AND(K=1) THENGOSUB2370
2330 RETURN
2340 FORI=1 TO3
2350 VE=8+I+2*V:HO=5-2*V:GOSUB110
2360 PRINT".":NEXTI:RETURN
2370 PRINT"..":FORI=1 TO6
2380 VE=8-I+(2*V):HO=8+(2*V):GOSUB110
2390 PRINT".":NEXTI:RETURN
2400 REM TEKEN F3
2410 VE=5:HO=10:GOSUB110
2420 IFF3=1 THENPRINT"++A++";
2430 IFF3=2 THENPRINT"++F++";
2440 VE=3:GOSUB110
2450 IFF3=3 THENPRINT"+V++";
2460 REM TEKEN RICHTING R3
2470 IF(R3=1) AND(F3<3) THENGOSUB2510
2480 IF(R3=2) AND(F3<3) AND(K=1) THENGOSUB2530
2490 IF(R3=3) AND(F3<3) THENGOSUB2560
2500 RETURN
2510 VE=5:HO=4:GOSUB110
2520 PRINT"++++++":RETURN
2530 VE=5:HO=9:GOSUB110:PRINT"+"
2540 FORI=1 TO4:VE=5-I:HO=8:GOSUB110
2550 PRINT"+":NEXTI:RETURN
2560 VE=5:HO=6:GOSUB110:PRINT"++++"
2570 FORI=1 TO6:VE=5+I:HO=5:GOSUB110
2580 PRINT"+":NEXTI:RETURN
2590 REM TEKEN F2
2600 VE=11:HO=8:GOSUB110
2610 IFF2=1 THENPRINT"A"
2620 IFF2=2 THENPRINT"F"
2630 IF(F2=1) OR(F2=2) THENFORI=0 TO1
2640 IF(F2=1) OR(F2=2) THENVE=12+I:GOSUB110
2650 IF(F2=1) OR(F2=2) THENPRINT"*":NEXTI
2660 HO=10:GOSUB110
2670 IFF2=3 THENPRINT"V"
2680 IFF2=3 THENFORI=0 TO1
2690 IFF2=3 THENVE=12+I:GOSUB110
2700 IFF2=3 THENPRINT"*":NEXTI
2710 REM TEKEN RICHTING R2
2720 IF(R2=1) AND(F2<3) AND(K=1) THENGOSUB2760
2730 IF(R2=2) AND(F2<3) THENGOSUB2780
2740 IF(R2=3) AND(F2<3) THENGOSUB2820
2750 RETURN
2760 FORI=1 TO9:VE=11-I:HO=8:GOSUB110
2770 PRINT"*":NEXTI:RETURN
2780 FORI=1 TO2:VE=11-I:HO=8:GOSUB110
2790 PRINT"*":NEXTI
2800 FORI=1 TO4:VE=8:HO=8+I:GOSUB110
2810 PRINT"*":NEXTI:RETURN
2820 FORI=1 TO5:VE=11-I:HO=8:GOSUB110
2830 PRINT"*":NEXTI
2840 FORI=1 TO6:VE=5:HO=8-I:GOSUB110
2850 PRINT"*":NEXTI:RETURN
2860 REM
2870 REM GEKOZEN OPLOSSING
2880 GOSUB210:GD=0
2890 IF(IN$>="0") AND(IN$<="3") THEN2910
2900 GOTO2880
2910 REM VERGELIJKING F EN R
2920 IFF3=4 THEN2950
2930 IFF2=4 THEN3040
2940 GOTO3190
2950 REM F1<4 & F2<4
2960 IF(F1=2) AND(F2=3) AND(R1=3) THEN3260
2970 IF(R1=2) THEN3260
2980 IF(F1>=F2) AND(R1<>2) THENGD=1:GOTO3300
2990 IF(F1=2) AND(F2=3) AND(R1=1) THENGD=1
3000 IF(F1=2) AND(F2=3) AND(R1=1) THEN3280
3010 IF(F2=3) AND(R1=3) THEN3260
3020 IFF1<F2 THENGD=2:GOTO3280
3030 GOTO3260
3040 REM F1<4 & F3<4
3050 IF(R1<3) AND(R3<3) THEN3260
3060 IF(R1=3) AND(R3=1) THENGD=3:GOTO3320
3070 IF(R1=1) AND(R3=3) THENGD=3:GOTO3280
3080 IF(R1=3) AND(R3=3) AND(F1<F3) THENGD=2
3090 IF(R1=3) AND(R3=3) AND(F1<F3) THEN3280
3100 IF(R1=3) AND(R3=3) AND(F1>F3) THENGD=2
3110 IF(R1=3) AND(R3=3) AND(F1>F3) THEN3320
3120 IF(F1=F3) AND(R1=3) AND(R3=2) THENGD=1
3130 IF(F1=F3) AND(R1=3) AND(R3=2) THEN3320
3140 IF(F1=F3) AND(R1=2) AND(R3=3) THENGD=1
3150 IF(F1=F3) AND(R1=2) AND(R3=3) THEN3280
3160 IF(F1>F3) AND(R1=2) AND(R3=3) THEN3280
3170 IF(F1<F3) AND(R1=2) AND(R3=3) THEN3280
3180 GD=1:GOTO3320
3190 REM F2<4 & F3<4
3200 IFR2=2 THEN3260
3210 IFF2>=F3 THENGD=1:GOTO3320
3220 IF(R2=3) AND(F3=3) THEN3260
3230 IF(F2=2) AND(F3=3) AND(R2=1) THENGD=1
3240 IF(F2=2) AND(F3=3) AND(R2=1) THEN3280
3250 GD=2:GOTO3300
3260 IFIN$="0" THEN3430
3270 GOTO3340
3280 IFIN$="1" THEN3430
3290 GOTO3340
3300 IFIN$="2" THEN3430
3310 GOTO3340
3320 IFIN$="3" THEN3430
3330 GOTO3340
3340 REM FOUT
3350 GOSUB1090
3360 PRINT"DAT IS NIET GOED.":GOSUB250
3370 IFGD=0 THENGOSUB1860
3380 IFGD=1 THENGOSUB1150
3390 IFGD=2 THENGOSUB1190
3400 IFGD=3 THENGOSUB1240
3410 GOSUB1070:VE=14:HO=0:GOSUB110:GD=4
3420 GOTO3460
3430 REM GOED
3440 GOSUB1070:PRINT"GOED ZO!"
3450 SC=SC+1
3460 REM
3470 PRINT"DRUK : V=VOLGENDE S=STOP"
3480 PRINT" R=VOORRANGSREGELS"
3490 GOSUB210
3500 IF(IN$="S") OR(IN$="s") THEN3740
3510 IF(IN$="V") OR(IN$="v") THENGOSUB3540:GOTO1990
3520 Q=0:IF(IN$="R") OR(IN$="r") THENQ=1
3525 IFQ=1 THENGOSUB1110:GOSUB3540:GOTO1990
3530 GOTO3490
3540 REM WIS OUDE SITUATIE
3550 FORI=1 TO12:VE=I:HO=5
3560 GOSUB110:PRINT" ":NEXTI
3570 VE=3:HO=10:GOSUB110:PRINT" "
3580 VE=5:HO=0:GOSUB110
3590 PRINT" "
3600 VE=8:GOSUB110
3610 PRINT" "
3620 VE=10:GOSUB110:PRINT" "
3630 FORI=10 TO13
3640 VE=I:HO=10:GOSUB110
3650 PRINT" ";:NEXTI:PRINT" "
3660 VE=13:HO=8:GOSUB110:PRINT" "
3670 IFK=0 THENVE=4:HO=5:GOSUB110
3680 IFK=0 THENPRINT"----"
3690 FORI=14 TO15
3700 VE=I:HO=0:GOSUB110
3710 PRINTE$:NEXTI
3720 REM NAAR NIEUWE OPGAVE
3730 RETURN
3740 REM EINDSCORE
3750 GOSUB3540:VE=14:GOSUB110
3760 PRINTPP;" OPGAVEN ";SC;" GOED "
3770 IFPP=0 THEN3790
3780 PRINT"DAT IS ";ABS(INT(SC*100/PP));" PROCENT."
3790 XT=15:GOSUB1030
3800 END
3810 REM MENU
3820 SC=0:PP=0
3830 E$=" "
3840 GOSUB100
3850 PRINT" MENU"
3860 PRINT:PRINT:PRINT" 1 - KRUISING "
3870 PRINT:PRINT:PRINT" 2 - T-SPLITSING "
3880 PRINT:PRINT:PRINT" 3 - VOORRANGSREGELS DEMO"
3890 K=0:GOSUB210
3900 IFIN$="1" THENK=1:GOTO3940
3910 IFIN$="2" THENK=0:GOTO3940
3920 IFIN$="3" THENGOSUB4220:GOSUB1110:GOTO3840
3930 GOTO3890
3940 REM
3950 IFK=1 THENGOSUB4090
3960 IFK<>1 THENGOSUB4220
3970 GOSUB3990
3980 GOTO1990
3990 REM TEKST
4000 RESTORE:FORI=1 TO16
4010 VE=I:HO=17:GOSUB110
4020 READT$:IFT$="##" THENGOSUB4060
4030 IFT$="$$" THENI=16:GOTO4050
4040 PRINTT$
4050 NEXTI:RETURN
4060 T$="":I=0:PRINT"DRUK EEN TOETS"
4070 GOSUB210
4080 RETURN
4090 REM TEKEN KRUISING
4100 GOSUB100
4110 VE=0:HO=0:GOSUB110
4120 FORI=1 TO4:PRINT" ! !":NEXTI
4130 VE=4:HO=0:GOSUB110
4140 PRINT"----+ +----"
4150 REM
4160 PRINT:PRINT" 3"
4170 PRINT"1":PRINT
4180 PRINT"----+ +----"
4190 FORI=1 TO4:PRINT" ! !":NEXTI
4200 VE=13:HO=7:GOSUB110:PRINT"2"
4210 RETURN
4220 REM TEKEN T-SPLITSING
4230 GOSUB100
4240 PRINT:PRINT:PRINT:PRINT
4250 PRINT"--------------"
4260 GOTO4150
20000 REM REGELS WISSEN VOOR C-64
20010 REM VOOR ANDERE COMPUTERS
20020 REM MEESTAL OVERBODIG
20030 HO=0:VE=16:GOSUB110
20040 PRINT" "
20050 PRINT" "
20060 PRINT" "
20070 PRINT" "
20080 RETURN
25000 DATA"ALLE FIGUREN "
25010 DATA"VOLGEN DE AAN- "
25020 DATA"GEGEVEN LIJN. "
25030 DATA"EEN VOETGANGER "
25040 DATA"GAAT ALTIJD "
25050 DATA"RECHTDOOR,EN "
25060 DATA"STEEKT DUS "
25070 DATA"OVER. "
25080 DATA" "
25090 DATA "##"
25100 DATA"WIE MAG ALS "
25110 DATA"EERSTE DOOR- "
25120 DATA"GAAN ? "
25130 DATA" "
25140 DATA"1 OF 2 OF 3"
25150 DATA" OF "
25160 DATA"0 (ONBEPAALD) "
25170 DATA" "
25180 DATA"A = AUTO "
25190 DATA"F = FIETS "
25200 DATA"V = VOETGANGER "
25210 DATA"$$"
30000 REM
30010 REM VERKEER
30020 REM
30030 REM DOOR K.V.D.WISSEL
30040 REM NIEUWSTRAAT 306
30050 REM 3201EG SPIJKENISSE
30060 REM 01880-18872
30070 REM
30080 REM OP ZX-SPECTRUM
30090 REM ISSUE-2
30100 REM
30110 REM COPYRIGHT
30120 REM NOS-HOBBYSCOOP