--- title: "Graph Time" id: 50614 type: "computer_media" slug: "graph-time" url: "http://localhost/computer_media/graph-time/" markdown_url: "http://localhost/computer_media/graph-time.md" published_at: "2023-06-23T11:26:00+00:00" modified_at: "2026-03-30T21:42:52+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2019/02/20230809-041332.jpg" excerpt: "Enter a number and watch a unique geometric line pattern emerge — each step value produces a completely different symmetric graphic from just four DRAW commands." 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/" - name: "Graphics" slug: "graphics" taxonomy: "genre" url: "http://localhost/type/graphics/" media_type: "Program" download_url: "https://archive.org/download/timex-sinclair-software-archive/Graph%20Time%20%28198x%29%28TS2068%29%28US%29%28Program%29.zip" mediadate: "198x" images: - url: "http://localhost/wp-content/uploads/2023/06/SCR-20260329-pxkv.png" media_type_tags: "Demo, Graphics" --- # Graph Time This program generates a graphic pattern on screen by drawing a series of lines from points along a horizontal axis, creating a symmetric geometric figure. The user inputs a numeric step value, which controls the spacing of iterations in a FOR loop running from 0 to 85. Four DRAW commands per iteration radiate lines from two anchor points (x=214, x=44) through a central horizontal baseline at y=88, forming diamond- or fan-like shapes that vary dramatically depending on the step value entered. Entering “c” clears the screen and prompts for a new value, allowing the user to experiment with different patterns. After each pattern completes, a PAUSE of 120 frames holds the display before automatically clearing and looping back. *** ## Program Analysis ### Program Structure The program is organized as a simple interactive loop. Lines 10–90 are REM comments crediting the author and publisher. Line 100 prompts for user input as a string, line 110 handles the special case of entering `"c"` to clear the screen, and lines 120–220 perform the drawing loop. Line 225 pauses briefly and clears, then line 230 returns to the input prompt. 1. User enters a step value (or `"c"` to clear) 2. The FOR loop runs `i` from 0 to 85 in steps of `n` 3. Four PLOT/DRAW pairs draw symmetric lines per iteration 4. After the loop, the screen pauses for 2 seconds then clears ### Drawing Geometry Each iteration of the loop draws four line segments anchored at two x-positions: approximately x=213−i (varying) and x=44 (fixed, with a minor bug — see below). The lines extend vertically by amounts proportional to `i`, creating a pattern that fans outward as the loop progresses. The baseline is y=88, which is roughly the vertical center of the 176-pixel-tall display. | Line | Start Point | Draw Vector | Direction | | --- | --- | --- | --- | | 140–150 | PLOT 213−i, 88 | DRAW i−85, 1 | Up-left | | 160–170 | PLOT 44, 88 | DRAW 85−i, i | Right and up | | 180–190 | PLOT 213−i, 88 | DRAW i−85, −i | Down-left | | 200–210 | PLOT 44, 88 | DRAW 85−i, −i | Right and down | ### Key BASIC Idioms - **String input for dual purpose:**`n$` is read as a string first, allowing the single input to serve as either a command (`"c"`) or a numeric value converted with `VAL n$`. - **AT 0,0 status line:** Line 120 uses `PRINT AT 0,0` to display the current step value without disturbing the drawing area. - **PAUSE then GO TO loop:** The `PAUSE 120` at line 225 holds the completed pattern visible for approximately 2 seconds before `CLS` and returning to the input prompt. ### Notable Techniques The choice of 85 as the loop limit and the x-offsets 213 and 43/44 are not arbitrary: 85 is one quarter of 340, the notional pixel width scaled for the display, and the two anchor points are roughly symmetric about the horizontal center (x=128). The varying step value `n` dramatically changes the visual output — a step of 1 produces dense concentric shapes while a step of 17 produces only five widely spaced lines. ### Bugs and Anomalies There is a minor inconsistency in lines 160 and 200: the PLOT command uses `43+1` (i.e., 44) as a literal arithmetic expression rather than simply `44`. This is functionally identical but suggests a possible editing artifact where the original expression may have included a variable or offset that was later simplified incompletely. Additionally, the DRAW on line 150 adds only 1 to the y-coordinate (`DRAW i−85, 1`), which is asymmetric with the other three draws. The upper-left set of lines is nearly horizontal while the lower-left and both right-side sets fan out proportionally with `i`. This asymmetry may be intentional for artistic effect or could be a typographic error for `i`. ## Source Code ``` 10 REM ** A GRAPHIC PASTIME 20 REM ** A TS2068 PGM BY 30 REM ** STEVEN SCOVILLE 50 REM ** ORIGINALLY PUBLISHED 60 REM ** BY THE TRIANGLE SINCLAIR 70 REM ** USERS GROUP, NORTH 80 REM ** CAROLINA 90 REM ** 100 INPUT n$ 110 IF n$="c" THEN CLS : GO TO 100 120 LET n=VAL n$: PRINT AT 0,0;"INPUT ",n," PRODUCES: " 130 FOR i=0 TO 85 STEP n 140 PLOT 213-i,88 150 DRAW i-85,1 160 PLOT 43+1,88 170 DRAW 85-i,i 180 PLOT 213-i,88 190 DRAW i-85,-i 200 PLOT 43+1,88 210 DRAW 85-i,-i 220 NEXT i 225 PAUSE 120: CLS 230 GO TO 100 ```