--- title: "Rockets" id: 55722 type: "computer_media" slug: "rockets" url: "http://localhost/computer_media/rockets/" markdown_url: "http://localhost/computer_media/rockets.md" published_at: "2024-07-05T00:18:47+00:00" modified_at: "2026-03-30T21:45:13+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2019/02/20230809-041332.jpg" excerpt: "A countdown of flashing borders and beeps precedes an ASCII rocket launch, then random stars scatter across the screen in celebration." 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 2068" slug: "ts2068" taxonomy: "post_tag" url: "http://localhost/tag/ts2068/" model: - name: "Timex/Sinclair 2068" slug: "ts-2068" taxonomy: "model" url: "http://localhost/model/ts-2068/" genre: - name: "Demo" slug: "demo" taxonomy: "genre" url: "http://localhost/type/demo/" media_contents: - id: 55711 title: "ISTUG Public Domain Library 8" type: "computer_media" url: "http://localhost/computer_media/istug-public-domain-library-8/" media_type: "Program" download_url: "https://archive.org/download/timex-sinclair-software-archive/Rockets%20%28198x%29%28TS2068%29%28US%29%28Program%29.zip" mediadate: "198x" images: - url: "http://localhost/wp-content/uploads/2024/07/SCR-20260329-orpg.png" media_type_tags: "Demo" --- This program draws an ASCII-art rocket on screen using a sequence of BORDER and BEEP calls to create a countdown effect before the rocket appears. After rendering the rocket with character-graphics lines (nose cone, body, and exhaust flames using backslashes and exclamation marks), it scatters 40 randomly positioned stars across the screen using PRINT AT with RND-generated row and column values. The program ends with a “HURRAY!” message and loops back via GO SUB to repeat the border-color and beep sequence. Line 15’s STOP is bypassed on auto-run because execution begins at line 20, leaving line 15 as a manual-run guard. *** ## Program Analysis ### Program Structure The program is divided into three logical phases. Lines 10–90 implement a countdown using alternating `BORDER` color changes and `BEEP` tones with increasing `PAUSE` durations (60, 120, 180 frames). Lines 100–270 draw the rocket entirely with ASCII characters via successive `PRINT` statements. Lines 280–370 scatter random stars, print a victory message, then loop back to line 10 via `GO SUB 10` to repeat the light-and-sound sequence indefinitely. ### Rocket Drawing Technique The rocket is drawn starting at `AT 21,16` — near the bottom-right of the screen — and uses the double-comma (`,,`) idiom at the end of each `PRINT` statement. In Sinclair BASIC, a trailing comma after a `PRINT` item moves to the next print zone; two commas together effectively advance to the start of the next line at the same horizontal tab position, stacking the rocket body vertically in a column. The rocket consists of 17 lines: a pointed nose cone, rectangular body, and flame exhaust using `/`, `\`, and `!` characters. ### Star Field Generation Lines 320–340 use a `FOR` loop to place 40 asterisks at random screen positions. `INT(RND*32)` generates a column in the range 0–31 and `INT(RND*22)` generates a row in 0–21, covering the full 32×22 character display. These are passed directly to `PRINT AT Z,A;"*"`, which can overwrite parts of the previously drawn rocket — a minor cosmetic anomaly. ### Control Flow and the GO SUB Idiom `GO SUB 10` at line 360 jumps back into the countdown sequence but never formally returns via `RETURN`, since the countdown falls through into the rocket-drawing and star-scattering code again. This creates an infinite animation loop rather than a true subroutine call, and the return address pushed onto the GOSUB stack is never consumed, which will eventually exhaust stack space after many iterations. ### Notable Techniques and Anomalies - Line 15 contains a `STOP` statement that is skipped during normal auto-run execution (which begins at line 20), acting as a safeguard if the program is manually RUN from line 1. - `PAPER 0` and `INK 7` at lines 315–317 set black background and white ink before the star field, providing contrast for the asterisks but potentially altering the appearance of the already-drawn rocket text. - The increasing `PAUSE` durations (60, 120, 180) create an accelerating countdown feel despite being evenly spaced musically. - The `BEEP` pitches rise by one semitone each step (3, 4, 5, then 6), giving an ascending scale effect synchronized with the border color changes. - The trailing `STOP` at line 370 is unreachable in normal execution flow due to the unconditional `GO SUB 10` at line 360. ### Line Reference Table | Lines | Function | | --- | --- | | 10–90 | Countdown: cycling BORDER colors, BEEP tones, PAUSE delays | | 100–270 | ASCII rocket drawing via stacked PRINT statements | | 280–310 | Post-draw border/beep flash | | 315–317 | Set PAPER/INK attributes for star field | | 320–340 | Random star field loop (40 stars) | | 350–370 | Victory message, loop via GO SUB, unreachable STOP | ## Source Code ``` 5 REM PROGRAM *** "ROCKETS" 10 BORDER 1 15 STOP 20 CLS : BEEP 1,3 30 PAUSE 60 40 BORDER 2 50 BEEP 1,4 60 PAUSE 120 70 BORDER 3 80 BEEP 1,5 90 PAUSE 180 100 PRINT AT 21,16;" * ",, 120 PRINT " *** ",, 130 PRINT " ***** ",, 140 PRINT "*******",, 150 PRINT "* *",, 160 PRINT "* *",, 170 PRINT "* *",, 180 PRINT "* *",, 190 PRINT "* *",, 200 PRINT "* *",, 210 PRINT "* *",, 220 PRINT "*******",, 230 PRINT "*******",, 240 PRINT "/ \\ / \\",, 250 PRINT "!!! !!!",, 260 PRINT "!!! !!!",, 270 PRINT "!!! !!!" 280 BORDER 4 290 BEEP 1,6 300 PAUSE 60 310 BORDER 5 315 PAPER 0 317 INK 7 320 FOR L=1 TO 40 325 LET A=INT (RND*32) 330 LET Z=INT (RND*22) 335 PRINT AT Z,A;"*" 340 NEXT L 350 PRINT "HURRAY!"; 360 GO SUB 10 370 STOP 9998 SAVE "ROCKETS" LINE 20 ```