This file is part of Synchro-Sette May 1984. Download the collection to get this file.
A route-planning game on a grid of 35 boxes, five rows by seven columns, labelled with inverse letters and numbers. The player chooses how many obstacles to place, and they appear as inverse asterisks in randomly chosen boxes. A cursor starting in the top left box is moved with keys 5–8, and every starred box it reaches is cleared. Clearing them all wins, and the game is lost if the countdown in the corner reaches zero first. A separate counter shows the number of moves made.
Program Analysis
Program Structure
- Grid (lines 1000–1320): 35 boxes are drawn with block graphics. Rows are labelled with
CHR$ (166+N)(inverse A–E) and columns withCHR$ (157+N)(inverse 1–7). - Setup (lines 20–350): asks for the number of obstacles
S, sets the countdownT=INT (1.75*S+1.5), and marks random cells in the 35-character stringB$. - Play (lines 500–990): blinks the cursor, decrements
T, reads a key and jumps to100*(CODE A$-27), one handler per direction. Each handler moves four screen columns or rows, counts the move and clears an obstacle it lands on.
Notable Techniques
- Screen position is converted to a cell index with
7*((X-3)/4)+(Y-3)/4+1, soB$serves as the game board. - The direction dispatch
GOTO 100*(CODE A$-27)sends keys 5–8 straight to lines 600, 700, 800 and 900.
Potential Issues
Tgoes down on every pass of the key-polling loop (line 515), not on every move, so it acts as a time limit. Its starting value is based on the number of obstacles, as though it were meant to be a move allowance.- Obstacles are placed only in cells 2–35. Asking for 35 or more, or for 0, leaves the placement loop unable to finish.
- If a cell is chosen twice the program just tries again, so a large obstacle count takes a long time to place.
Source Code
10 GOTO 1000
20 RAND
30 RAND
40 PRINT AT 21,0;"HOW MANY OBSTACLES?"
50 INPUT S
55 LET T=INT (1.75*S+1.5)
60 LET B$=" "
65 LET O=0
70 LET A=0
75 PRINT AT 21,28;T
80 LET X=3
90 LET Y=3
100 PRINT AT 21,0;" "
110 FOR N=2 TO 35
125 LET B=INT (10*RND)
130 IF B<2 THEN GOTO 200
140 NEXT N
150 GOTO 110
200 IF B$(N)="[*]" THEN GOTO 140
210 LET B$(N)="[*]"
220 LET A=A+1
230 IF A=S THEN GOTO 300
240 GOTO 140
300 FOR N=1 TO 7
310 PRINT AT 3,N*4-1;B$(N);AT 7,N*4-1;B$(N+7);AT 11,N*4-1;B$(N+14);AT 15,N*4-1;B$(N+21);AT 19,N*4-1;B$(N+28)
320 NEXT N
330 LET C$=B$
340 LET A=1
350 PAUSE 40000
500 LET A$=INKEY$
510 PRINT AT X,Y;"█";AT X,Y;" "
515 LET T=T-1
516 PRINT AT 21,28;T;" ";
517 IF T=0 THEN GOTO 2000
520 IF CODE A$<33 OR CODE A$>36 THEN GOTO 500
530 PRINT AT 21,0;"MOVES = ";A
540 GOTO 100*(CODE A$-27)
600 IF Y<>3 THEN LET A=A+1
610 IF Y<>3 THEN LET Y=Y-4
620 IF B$(7*((X-3)/4)+(Y-3)/4+1)="[*]" THEN GOTO 640
630 GOTO 500
640 LET B$(7*((X-3)/4)+(Y-3)/4+1)=" "
650 LET O=O+1
660 IF O=S THEN GOTO 3000
690 GOTO 500
700 IF X<>19 THEN LET A=A+1
710 IF X<>19 THEN LET X=X+4
720 IF B$(7*((X-3)/4)+(Y-3)/4+1)="[*]" THEN GOTO 640
790 GOTO 500
800 IF X<>3 THEN LET A=A+1
810 IF X<>3 THEN LET X=X-4
820 IF B$(7*((X-3)/4)+(Y-3)/4+1)="[*]" THEN GOTO 640
890 GOTO 500
900 IF Y<>27 THEN LET A=A+1
910 IF Y<>27 THEN LET Y=Y+4
920 IF B$(7*((X-3)/4)+(Y-3)/4+1)="[*]" THEN GOTO 640
990 GOTO 500
998 FAST
999 STOP
1000 FAST
1010 FOR X=2 TO 19 STEP 4
1020 FOR Y=2 TO 28 STEP 4
1030 PRINT AT X,Y;"▛▀▜"
1040 PRINT AT X+1,Y;"▌ ▐"
1050 PRINT AT X+2,Y;"▙▄▟"
1060 NEXT Y
1070 NEXT X
1080 FOR N=0 TO 4
1090 PRINT AT 3+N*4,0;CHR$ (166+N)
1100 NEXT N
1280 FOR N=0 TO 6
1290 PRINT AT 0,3+N*4;CHR$ (157+N)
1300 NEXT N
1310 SLOW
1320 GOTO 20
2000 PRINT AT 21,0;"█[G][A][M][E]█[O][V][E][R]█[-]█[Y][O][U]█[L][O][S][E]█[:][:][:]█"
2010 FOR N=1 TO 100
2020 NEXT N
2030 PAUSE 40000
2040 FAST
2050 CLS
2060 RUN
3000 PRINT AT 21,0;"█[Y][O][U]█[W][I][N]█[:][:][:][:]█"
3010 PRINT AT X,Y;"*"
3020 GOTO 2010
9997 STOP
9998 SAVE "SHORT-ROUT[E]"
9999 RUNNote: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.
