--- title: "Short-Route" id: 72038 type: "computer_media" slug: "short-route" url: "http://localhost/computer_media/short-route/" markdown_url: "http://localhost/computer_media/short-route.md" published_at: "2026-10-20T14:07:38+00:00" modified_at: "2026-10-20T14:18:46+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2026/10/4_SHORT-ROUTE.png" excerpt: "Race a countdown to visit every starred cell on a 5 by 7 grid of boxes, picking the shortest route before the timer reaches zero." category: - name: "Archived Media" slug: "archived-media" taxonomy: "category" url: "http://localhost/category/archived-media/" post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "TS 1000" slug: "ts1000" taxonomy: "post_tag" url: "http://localhost/tag/ts1000/" model: - name: "Timex/Sinclair 1000" slug: "ts-1000" taxonomy: "model" url: "http://localhost/model/ts-1000/" indiv: - name: "Gene G. Buza" slug: "gene-g-buza" taxonomy: "indiv" url: "http://localhost/indiv/gene-g-buza/" genre: - name: "Game" slug: "game" taxonomy: "genre" url: "http://localhost/type/game/" media_contents: - id: 72046 title: "Synchro-Sette May 1984" type: "computer_media" url: "http://localhost/computer_media/synchro-sette-may-1984/" media_type: "Program" programmers: - name: "Gene G. Buza" slug: "gene-g-buza" taxonomy: "indiv" url: "http://localhost/indiv/gene-g-buza/" mediadate: "1984" images: - url: "http://localhost/wp-content/uploads/2026/10/4_SHORT-ROUTE.png" media_type_tags: "Game" --- # Short-Route 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 1. **Grid** (lines 1000–1320): 35 boxes are drawn with block graphics. Rows are labelled with `CHR$ (166+N)` (inverse A–E) and columns with `CHR$ (157+N)` (inverse 1–7). 2. **Setup** (lines 20–350): asks for the number of obstacles `S`, sets the countdown `T=INT (1.75*S+1.5)`, and marks random cells in the 35-character string `B$`. 3. **Play** (lines 500–990): blinks the cursor, decrements `T`, reads a key and jumps to `100*(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`, so `B$` 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 - `T` goes 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 RUN ```