--- title: "TS2068 Utilities" type: "article" slug: "ts2068-utilities-2" url: "http://localhost/article/ts2068-utilities-2/" markdown_url: "http://localhost/article/ts2068-utilities-2.md" published_at: "2022-10-07T12:27:03+00:00" modified_at: "2026-08-08T22:07:50+00:00" featured_image: url: "http://localhost/wp-content/uploads/2022/04/20230809-041332.jpg" excerpt: "This month the program ideas and hints are from T/S 2068 Basics and Beyond. I hope you find them useful. This program is written to display the power of the \"POINT\" command. It will draw a maze; then check for walls with the POINT command, as you guide the dot through the maze with the…" category: - name: "SMUG Bytes" slug: "smug-bytes" taxonomy: "category" url: "http://localhost/category/periodicals/smug-bytes/" post_tag: - name: "Best of Timex/Sinclair 2068 Articles and Documents" slug: "ts2068best" taxonomy: "post_tag" url: "http://localhost/tag/ts2068best/" - name: "TS 2068" slug: "ts2068" taxonomy: "post_tag" url: "http://localhost/tag/ts2068/" - name: "Type-in program" slug: "type-in-program" taxonomy: "post_tag" url: "http://localhost/tag/type-in-program/" model: - name: "Timex/Sinclair 2068" slug: "ts-2068" taxonomy: "model" url: "http://localhost/model/ts-2068/" publication_r: id: 37935 title: "SMUG Bytes" type: "periodical" url: "http://localhost/periodical/smug-bytes/" volume: "6" issue: "7" issues_articles: - id: 39722 title: "SMUG Bytes v6 n7" type: "issue" url: "http://localhost/issue/smug-bytes-v6-n7/" pages: "8" pubdate: "July 1989" archive_link: false --- # TS2068 Utilities This month the program ideas and hints are from T/S 2068 Basics and Beyond. I hope you find them useful. This program is written to display the power of the “POINT” command. It will draw a maze; then check for walls with the POINT command, as you guide the dot through the maze with the arrow keys. ``` 10 PLOT 0,10: LET d=40 15 FOR i=1 to 2: FOR n=1 to 12 20 READ a,b: DRAW a,b: NEXT n 25 PLOT 10,0: LET d=20: RESTORE: NEXT i 30 DATA 20,0,0,50,30,0,0,60,d,0,30,0 35 DATA 0,-30,20,0,0,-40,20,0,0,-20,30,0 40 LET X=5: LET y=5 45 PLOT x, y 50 IF INKEY$="" THEN GO TO 50 55 LET a$=INKEY$ 60 LET px=x: LET py=y 65 IF a$="5" THEN LET x=X-1 70 IF a$="6" THEN LET y=y-1 75 IF a$="7" THEN LET y=y+1 80 IF a$="g" THEN LET x=x+1 85 IF POINT (X,Y) THEN GO TO 100 90 PLOT OVER 1;Px,Py 95 GO TO 45 100 BEEP .25,1 105 LET x-px: LET y=py: GO TO 45 ``` Lines 10 to 35 DRAWs a simple maze. Since the two lines are basically the same, the same DATA is used for each, beginning at a different PLOT point. The one segment in the middle must be of a different size for the top and bottom of the path, so a variable is placed in the DATA statement for it. Lines 40 to 45 puts a dot on the screen for steering through the path. Line 50 Waits for a key press. Line 60 Saves the dot position in variables px & py for later erasure. Lines 65 to 80 assigns new values to x and y in response to the key press. Line 85 If the spot indicated by the new x,y coordinate already has an INK pixel, indicating you have bumped into a wall, then go to subroutine. Line 90-95 erases the dot and loops back to print it in the new position. Lines 100-105 If you have hit a wall, resets the x and y values to what they were before you pressed the cursor keys and loops back for another try.