--- title: "Easy Draw" id: 70778 type: "computer_media" slug: "easy-draw" url: "http://localhost/computer_media/easy-draw/" markdown_url: "http://localhost/computer_media/easy-draw.md" published_at: "2026-08-23T15:08:07+00:00" modified_at: "2026-08-23T20:12:57+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2026/08/easy-draw-1.png" alt: "Easy Draw screen" excerpt: "A dual-mode drawing tool that lets you sketch using block graphics or pixel-level plotting, with color selection, brightness, and fill features all driven from the keyboard." 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: "Art" slug: "art" taxonomy: "genre" url: "http://localhost/type/art/" media_type: "Program" download_url: "https://archive.org/download/timex-sinclair-software-archive/Easy%20Draw%20%28198x%29%28-%29%28TS2068%29%28US%29%28Program%29.zip" mediadate: "198x" images: - url: "http://localhost/wp-content/uploads/2026/08/easy-draw-1.png" alt: "Easy Draw screen" - url: "http://localhost/wp-content/uploads/2026/08/Easy-Draw.png" alt: "Easy Draw screen" media_type_tags: "Art" --- # Easy Draw Easy Draw is a freehand drawing program offering two distinct input modes: a block graphics mode that positions a cursor on the 22×32 character grid, and a high-resolution graphics mode that uses PLOT to address the 256×176 pixel screen. The program uses an 8-key directional scheme (keys 1–4 for diagonals, 5–8 for cardinal directions) in both modes, with separate coordinate systems that are converted between each other via scaling constants (8.3333333 and 8.2258065). Color selection is mapped to the top keyboard row (Q through I), producing a musical tone via BEEP for each color chosen. Additional features include a BRIGHT toggle, a FILL mode that triggers a border-drawing routine, double-speed drawing (which disables color and some other keys), and a screen-print function toggled by keys P and O. *** ### Program Structure The program is organized into several functional regions: 1. Lines 20–150: Title screen and instructions display, waiting for any keypress via `PAUSE 5000`. 2. Lines 160–230: Two-stage color selection — border color first, then screen color — both routed through the color-picker subroutine at line 800. 3. Lines 250–280: Variable initialization and border-drawing loop. 4. Lines 300–600: High-resolution PLOT mode, converting character coordinates to pixel coordinates and responding to directional keys. 5. Lines 620–780: Block graphics (character cell) mode, moving and printing colored spaces on the character grid. 6. Lines 800–940: Color selection subroutine, shared by both setup and in-drawing color changes. ### Dual-Mode Drawing The program maintains two parallel sets of coordinates. The character-grid position is stored in `x` (row, 1–20) and `y` (column, 1–30). The pixel position is stored in `xx` and `yy`. At line 300–310, character coordinates are converted to pixel equivalents using the formulas: - `xx = 175 - (8.3333333 * x)` — maps rows to vertical pixel position, inverted because PLOT’s y-axis runs bottom-up. - `yy = 8.2258065 * y` — maps columns to horizontal pixel position. The flag variable `e` controls which mode is active: `e=0` is PLOT mode and `e=1` is block graphics mode. Switching between them is done with keys `S` (exit block mode) and `A` (enter block mode). ### Key Mapping and Direction Scheme Both modes share an identical 8-direction key layout. Directions are not mapped to the traditional cursor keys but to the digit row 1–8: | Key | Direction | | --- | --- | | 1 | Diagonal up-left (or equivalent in pixel mode) | | 2 | Diagonal down-left | | 3 | Diagonal down-right | | 4 | Diagonal up-right | | 5 | Up | | 6 | Left | | 7 | Right | | 8 | Down | Note that the diagonal assignments in PLOT mode (lines 460–490) are axis-inverted relative to block mode (lines 640–670) due to the coordinate system difference, but both feel consistent to the user because the screen inversion is handled by the coordinate conversion. ### Drawing Modes and the `f` Flag The variable `f` controls the drawing behavior: - `f=0`: Cursor moves without drawing. - `f=1`: Draws with BRIGHT attribute set (`BRIGHT 1`). - `f=2`: Normal drawing (no BRIGHT). - `f=3`: Double-speed mode, entered by key `D`. In this mode the main loop jumps directly to line 400, bypassing color key processing, the fill trigger check, and the block graphics mode entry point. ### Color Picker Subroutine (Lines 800–940) The color picker at line 800 displays a menu and then polls `INKEY$` in a tight loop at line 810. Each color key (Q through I) plays a distinct BEEP tone and sets `c` to the corresponding INK value. The tones are musically spaced but not on a standard equal-tempered scale — the semitone values given (0, 2.039, 3.86, 4.98, 7.02, 8.84, 10.88, 12) are an approximation of a major scale with some deviations. After color selection, the routine uses the `a` and `d` flags to decide whether to return (if called mid-drawing via `GO SUB 810`) or branch back to the appropriate setup step. A subtle structural point: line 810 is also used as a `GO SUB` target from line 380 during normal drawing (skipping the menu display at line 800). This allows color changes mid-draw without re-showing the menu. ### Border and Status Display When `h=0`, a decorative border of colored spaces is printed around the screen edge using a loop at line 270. The status display (line 390–400) shows row/column indicators (`>` and `<` on the current row, `v` on the current column) and prints the current pixel coordinates at the bottom of the screen. The `h` flag suppresses these in double-speed mode to maximize drawing throughput. ### Boundary Clamping Both coordinate systems have explicit boundary clamps. Pixel coordinates are clamped: `xx` between 8 and 167, `yy` between 8 and 247 (lines 540–570). Character coordinates clamp `x` to 1–20 and `y` to 1–30 (lines 720–750), keeping the cursor within the drawable area inside the border. ### Notable Techniques and Anomalies - The color key labels in the instruction screen say “QWERTYUI = BLUE, RED, MAGENTA, GREEN, CYAN, YELLOW, WHITE, BLACK” — this maps Q→INK 1 (blue) through I→INK 0 (black), which is correct for the Spectrum color numbering. - The `FOR k=1 TO 100:NEXT k` at line 805 is a short busy-wait delay inserted between displaying the color menu and entering the polling loop, likely to debounce the keypress that triggered the color picker. - The FILL function (key `0`, line 370) re-runs the border-drawing routine at line 270 rather than performing a true flood fill — it redraws the screen border in the current color, which is a practical workaround given BASIC’s limitations. - The `d` variable serves double duty: it is used as a flag to suppress the border/status overlays in double-speed mode (`h=0` check), and also signals the color subroutine to `RETURN` rather than branch (line 910). - The main loop at line 600 branches unconditionally back to line 330 rather than line 300, meaning the pixel coordinate conversion at lines 300–310 is skipped on subsequent iterations unless the character-cell mode updates `x`/`y` and returns to 300 at line 780. This is intentional: in PLOT mode, `xx` and `yy` are updated directly, so the conversion only needs to run when re-entering from block mode. ## Source Code ``` 20 PAPER 7:CLS 30 PRINT AT 0,11;"EASY DRAW"; AT 4,10;"INSTRUCTIONS" 50 PRINT AT 6,0;"DRAW KEYS = 1 TO 8 (1-4 diagonal5-8 as cursors)" 60 PRINT AT 8,0;"COLOUR KEYS=QWERTYUI (same orderas keyboard)" 70 PRINT AT 10,0;"KEY 9 = BRIGHT" 80 PRINT AT 11,0;"KEY 0 = FILL IN CURSER RUN (withdesired colour when finished)" 90 PRINT AT 13,0;"KEY P=PRINT : KEY O=STOP PRINT" 100 PRINT AT 14,0;"KEY A = BLOCK GRAPHICS (flashingcursor positioned)" 110 PRINT AT 16,0;"KEY S = HIGH RESOLUTION GRAPHICS(x,y plotted)" 120 PRINT AT 18,0;"SPACE KEY = RESTART" 130 PRINT AT 19,0;"KEY D=DOUBLE DRAW SPEED(disablescolours+space,9,0,O-P=NORMAL)" 140 PRINT FLASH 1; AT 21,12;"ANY KEY" 150 PAUSE 5000 160 PAPER 7:CLS 180 PRINT AT 3,6;"SELECT BORDER COLOUR" 190 LET a=0:LET c=8:LET d=0:GO TO 800 200 PAPER c:CLS :BORDER c:PAPER 7:CLS 210 PRINT AT 3,6;"SELECT SCREEN COLOUR" 220 LET c=8:LET a=1:GO TO 800 230 PAPER c:CLS 250 LET b=1:LET c=7:LET e=0:LET f=2:LET h=0:LET x=10:LET y=15 270 FOR g=1 TO 32:PRINT PAPER c; AT 0,h;" "; AT 21,h;" ":LET h=h+1:NEXT g:LET h=1:FOR g=1 TO 20:PRINT PAPER c; AT h,0;" "; AT h,31;" ":LET h=h+1:NEXT g:IF d=0 THEN LET h=0 280 LET c=0:LET d=1 300 LET xx=175-(8.3333333*x) 310 LET yy=8.2258065*y 330 IF x$="d" THEN LET f=3 340 IF f=3 THEN GO TO 400 350 IF x$="9" THEN LET f=1 360 IF x$="o" THEN LET f=0 370 IF x$="0" AND h=0 THEN GO TO 270 380 GO SUB 810 390 IF h=0 THEN PRINT PAPER 0; INK 7; AT x,0;">"; AT x,31;"<"; AT 0,y;"v" 400 IF h=0 THEN PRINT INK 0; PAPER 7; AT 21,4;"x="; INT xx;" "; AT 21,23;"y="; INT yy;" " 410 LET x$= INKEY$ 420 IF x$="p" THEN LET f=2 430 IF e=1 THEN GO TO 620 450 IF x$="a" THEN LET e=1 460 IF x$="1" THEN LET xx=xx+1:LET yy=yy+1 470 IF x$="2" THEN LET xx=xx-1:LET yy=yy+1 480 IF x$="3" THEN LET xx=xx-1:LET yy=yy-1 490 IF x$="4" THEN LET xx=xx+1:LET yy=yy-1 500 IF x$="5" THEN LET yy=yy-1 510 IF x$="6" THEN LET xx=xx-1 520 IF x$="7" THEN LET xx=xx+1 530 IF x$="8" THEN LET yy=yy+1 540 IF xx>167 THEN LET xx=167 550 IF xx<8 THEN LET xx=8 560 IF yy<8 THEN LET yy=8 570 IF yy>247 THEN LET yy=247 580 IF f=1 THEN PLOT BRIGHT 1; INK c;yy,xx 590 IF f>1 THEN PLOT INK c;yy,xx 600 GO TO 330 620 IF x$="s" THEN LET e=0 630 IF h=0 THEN PRINT PAPER 7; AT x,0;" "; AT x,31;" "; AT 0,y;" " 640 IF x$="1" THEN LET x=x-1:LET y=y+1 650 IF x$="2" THEN LET x=x+1:LET y=y+1 660 IF x$="3" THEN LET x=x+1:LET y=y-1 670 IF x$="4" THEN LET x=x-1:LET y=y-1 680 IF x$="5" THEN LET y=y-1 690 IF x$="6" THEN LET x=x+1 700 IF x$="7" THEN LET x=x-1 710 IF x$="8" THEN LET y=y+1 720 IF x<1 THEN LET x=1 730 IF x>20 THEN LET x=20 740 IF y<1 THEN LET y=1 750 IF y>30 THEN LET y=30 760 IF f=1 THEN PRINT BRIGHT 1; PAPER c; AT x,y;" " 770 IF f>1 THEN PRINT PAPER c; AT x,y;" " 780 GO TO 300 800 PRINT AT 10,12;"Q=BLUE"; AT 11,12;"W=RED"; AT 12,12;"E=MAGENTA"; AT 13,12;"R=GREEN"; AT 14,12;"T=CYAN"; AT 15,12;"Y=YELLOW"; AT 16,12;"U=WHITE"; AT 17,12;"I=BLACK" 805 FOR k=1 TO 100:NEXT k 810 LET x$= INKEY$ 820 IF x$="q" THEN BEEP .5,0:LET c=1 830 IF x$="w" THEN BEEP .5,2.039:LET c=2 840 IF x$="e" THEN BEEP .5,3.86:LET c=3 850 IF x$="r" THEN BEEP .5,4.98:LET c=4 860 IF x$="t" THEN BEEP .5,7.02:LET c=5 870 IF x$="y" THEN BEEP .5,8.84:LET c=6 880 IF x$="u" THEN BEEP .5,10.88:LET c=7 890 IF x$="i" THEN BEEP .5,12:LET c=0 900 IF x$=" " THEN GO TO 20 910 IF d=1 THEN RETURN 920 IF c=8 THEN GO TO 810 930 IF a=1 THEN GO TO 230 940 IF c<8 THEN GO TO 200 ```