Tollbooth

Developer(s): Gene G. Buza
Date: September 1983
Type: Program
Platform(s): TS 1000

Appears on

Cassette to accompany the September 1983 issue of Synchro-Sette.

Source Code

  10 FAST 
  20 DIM S(32)
  30 PRINT AT 10,0;"HOW MANY VEHICLES?"
  40 SLOW 
  50 INPUT HH
  60 FAST 
  70 CLS 
  75 PRINT AT 6,12;"\:'\''\''\''\''\''\''\':";AT 7,12;"\: $     \ :";AT 8,12;"\:.\..\..\..\..\..\..\.:"
  80 PRINT AT 18,1;"\:'\''\''\''\''\':";AT 19,1;"\: TOLL\ :";AT 20,1;"\:.\..\..\..\..\.:"
  90 PRINT AT 18,25;"\:'\''\''\''\''\''\':";AT 19,25;"\: BOOTH\ :";AT 20,25;"\:.\..\..\..\..\..\.:"
 100 LET A$="\:'\''\''\:  \ :\:  \ :\:  \ :\:  \ :\@@\@@\:  \ :\:  \ :\:  \ :\:  \ :\''\''\':"
 110 PRINT AT 1,0;A$
 120 PRINT AT 21,11;"\''\''\:     \ :\''\''"
 130 FOR N=2 TO 40
 140 PLOT 24-24*SIN (N/72*PI),N
 150 NEXT N
 160 FOR N=2 TO 40
 170 PLOT 39+24*SIN (N/72*PI),N
 180 NEXT N
 185 FOR Q=1 TO HH
 190 GOSUB 3000
 195 SLOW 
 200 LET R=RND
 210 IF R>.9 THEN LET A$="%T"
 220 IF R<.9 THEN LET A$="%C"
 230 GOSUB 2000
 300 FOR N=8 TO 2 STEP -1
 305 IF I<4 THEN LET I=4
 306 IF RR=0 AND I>13 THEN LET I=13
 307 IF I<18 AND RR=1 THEN LET I=18
 308 IF I>27 THEN LET I=27
 310 PRINT AT N,I;A$;AT N+1,II;" "
 320 LET II=I
 330 LET I=I+(INT (RND*3)-1)
 350 NEXT N
 355 IF II=0 THEN STOP 
 360 PRINT AT 2,II;" "
 370 GOSUB 4000
 390 NEXT Q
 396 PAUSE 40000
 397 FAST 
 398 CLS 
 399 RUN 
1000 IF A$="%T" THEN GOTO 1500
1010 LET RRR=INT (2*RND)
1020 IF RRR=1 THEN GOTO 1500
1030 LET I=I+(INT (RND*3)-1)
1100 RETURN 
1500 LET I=I+(INT (RND*3)-1)
1510 RETURN 
2000 FOR N=20 TO 16 STEP -1
2010 PRINT AT N,I;A$;AT N+1,II;" "
2020 NEXT N
2100 LET RR=INT (2*RND)
2110 IF A$="%T" THEN LET RR=1
2115 IF A$="%T" THEN GOTO 2500
2120 IF RR=1 THEN GOTO 2500
2130 FOR N=15 TO 9 STEP -1
2140 PRINT AT N,I;A$;AT N+1,II;" "
2150 LET II=I
2160 LET I=I-1
2170 NEXT N
2180 RETURN 
2500 FOR N=15 TO 9 STEP -1
2510 PRINT AT N,I;A$;AT N+1,II;" "
2520 LET II=I
2530 LET I=I+1
2540 NEXT N
2550 RETURN 
3000 LET I=15
3010 LET II=15
3020 RETURN 
4000 IF RR=0 THEN LET I=3*INT ((I/3)+1.5)-2
4002 IF RR=1 THEN LET I=3*INT ((I/3)+1.5)-3
4005 LET S(I)=S(I)+1
4010 PRINT AT 1,I;A$
4030 FOR N=1 TO 10
4040 NEXT N
4050 PRINT AT 1,I;"%*"
4060 FOR N=1 TO 10
4070 NEXT N
4080 PRINT AT 1,I;" "
4090 PRINT AT 0,I;S(I)
4100 IF A$="%C" THEN LET S(32)=S(32)+.3
4110 IF A$="%T" THEN LET S(32)=S(32)+.6
4115 GOSUB 5000
4120 PRINT AT 7,14;S$
4130 RETURN 
5000 LET S$=STR$ S(32)
5010 IF LEN S$=1 THEN LET S$=S$+".00"
5020 IF S$(LEN S$-1)="." THEN LET S$=S$+"0"
5030 RETURN 
9998 SAVE "TOLLBOOT%H"
9999 RUN 
Scroll to Top