--- title: "Racer (Syntax)" id: 76575 type: "computer_media" slug: "racer-syntax" url: "http://localhost/computer_media/racer-syntax/" markdown_url: "http://localhost/computer_media/racer-syntax.md" published_at: "2026-11-11T08:02:25+00:00" modified_at: "2026-11-11T08:02:25+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2026/11/racer-syntax-1.png" excerpt: "Steer a star down a winding road that scrolls up the screen; the road's turns come from bytes in the ROM instead of RND." 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/" - name: "ZX81" slug: "zx81" taxonomy: "post_tag" url: "http://localhost/tag/zx81/" model: - name: "Sinclair ZX81" slug: "zx81" taxonomy: "model" url: "http://localhost/model/zx81/" - name: "Timex/Sinclair 1000" slug: "ts-1000" taxonomy: "model" url: "http://localhost/model/ts-1000/" indiv: - name: "Dan Tandberg" slug: "dan-tandberg" taxonomy: "indiv" url: "http://localhost/indiv/dan-tandberg/" genre: - name: "Arcade" slug: "arcade" taxonomy: "genre" url: "http://localhost/type/arcade/" media_type: "Program" programmers: - name: "Dan Tandberg" slug: "dan-tandberg" taxonomy: "indiv" url: "http://localhost/indiv/dan-tandberg/" download_url: "https://archive.org/download/timex-sinclair-software-archive/Racer%20%281983%29%28Tandberg%2C%20Dan%29%28TS1000%29%28US%29%28Program%29.zip" mediadate: "1983" images: - url: "http://localhost/wp-content/uploads/2026/11/racer-syntax-1.png" - url: "http://localhost/wp-content/uploads/2026/11/racer-syntax-2.png" - url: "http://localhost/wp-content/uploads/2026/11/racer-syntax-3.png" article_media: - id: 19620 title: "Faster Pseudorandom Numbers" type: "article" url: "http://localhost/article/faster-pseudorandom-numbers/" media_type_tags: "Arcade" license: false --- # Racer (Syntax) A short racing game from an article on faster pseudorandom numbers. Instead of RND, which is slow, the program reads bytes from the ROM starting at a random address, and uses them to decide which way the road turns. The road scrolls up the screen; steer the star with Y (left) and 8 (right) to stay between the edges. When you hit an edge, the program shows how far you got and starts again. In 2K the game needs three extra lines (22 to 26) that fill the display file before it starts; the download has both versions. The article also prints two short listings comparing the speed of RND with reading the ROM. Published in Syntax October 1983 ([Faster Pseudorandom Numbers](https://timexsinclair.com/article/faster-pseudorandom-numbers/)). ## Source Code ``` 10 REM "RACER" 20 REM USE "Y" AND "8" TO STEER 30 LET S=0 40 LET R=RND*1000 50 LET G=15 60 LET A=16 70 SCROLL 80 LET XA=A 90 LET N=PEEK (R+S)/256 100 LET G=G+(N>.5 AND G<22)-(N<.5 AND G>0) 110 LET K$=INKEY$ 120 LET A=A+(K$="8")-(K$="Y") 130 PRINT AT 21,31;AT 21,G;"███ ███ ";AT 11,A; 140 IF PEEK (PEEK 16398+256*PEEK 16399)<>0 THEN GOTO 180 150 PRINT AT 10,XA;" ";AT 11,A;"*" 160 LET S=S+1 170 GOTO 70 180 PRINT S 190 PAUSE 1E4 200 CLS 210 RUN 22 FOR S=0 TO 21 24 PRINT TAB 31;" " 26 NEXT S ```