--- title: "Moire" id: 72756 type: "computer_media" slug: "moire-2" url: "http://localhost/computer_media/moire-2/" markdown_url: "http://localhost/computer_media/moire-2.md" published_at: "2026-10-26T23:19:22+00:00" modified_at: "2026-10-27T12:32:23+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2026/10/m-2.png" excerpt: "A short demo that sweeps XOR-drawn lines corner to corner across the screen in changing colours, building shifting moiré interference patterns." 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/" indiv: - name: "Roger Valentine" slug: "roger-valentine" taxonomy: "indiv" url: "http://localhost/indiv/roger-valentine/" genre: - name: "Graphics" slug: "graphics" taxonomy: "genre" url: "http://localhost/type/graphics/" media_type: "Program" programmers: - name: "Roger Valentine" slug: "roger-valentine" taxonomy: "indiv" url: "http://localhost/indiv/roger-valentine/" download_url: "https://archive.org/download/timex-sinclair-software-archive/Moire%20%28198x%29%28-%29%28TS2068%29%28US%29%28Program%29.zip" tsrun_member: "Moire (198x)(-)(TS2068)(US)(Program)/Moire (198x)(-)(TS2068)(US)(Program).tap" mediadate: "198x" images: - url: "http://localhost/wp-content/uploads/2026/10/m-2.png" - url: "http://localhost/wp-content/uploads/2026/10/m-3.png" - url: "http://localhost/wp-content/uploads/2026/10/m-1.png" media_type_tags: "Graphics" license: false --- # Moire Moire is a short graphics demo that fills the screen with moiré interference patterns. It sweeps pairs of straight lines corner to corner across the full 256 by 176 display, one pixel step at a time, in four passes per cycle. Because the lines are drawn with `OVER 1`, each pass partly erases what the earlier ones left, and the overlapping lines produce shifting curved bands. Every cycle switches to a new random ink colour on a black screen, and it runs until BREAK is pressed. From page 73, where it is listed as “Patterns 2” of [Roger Valentine’s The Timex Sinclair 2068](http://localhost/book/the-timex-sinclair-2068-what-can-you-do-with-it/). No author is named in the program. It is a different program from [Moire Patterns](/?p=71363). ## Program Analysis ### Program Structure Line 5 sets `OVER 1` and a black border and paper. The subroutine at line 100 draws, for each `X` from 0 to 255, a line from the bottom edge to the top-right corner and its mirror image from the top edge to the bottom-left corner. The subroutine at line 200 does the same between the top and bottom edges in the opposite diagonal. Line 25 runs them in the order 200, 100, 100, 200 for each colour. ### Notable Techniques - Exclusive-OR plotting (`OVER 1`) means a line drawn twice disappears, so repeated passes build and dissolve the pattern instead of simply filling the screen. - Line 20 picks a random ink from 1 to 7 and loops until it differs from the previous one, held in `A`, so each cycle visibly changes colour. ### Potential Issues - Colour is set per character cell, so wherever a new line passes, the whole cell takes the new ink, including older pixels in it. This is part of the effect rather than a bug. This copy came from one of Don Lambert’s Oliger (JLO SAFE) disks. The only change for tape was removing the Oliger “/” from the `SAVE` at line 9000 and setting the program to autorun. It was tested in ZEsarUX on an emulated TS2068. ## Source Code ``` 5 OVER 1: BORDER 0: PAPER 0: INK 2: CLS 10 GO SUB 100 15 LET A=2 20 LET I=INT (RND*7)+1: IF I=A THEN GO TO 20 25 INK I: LET A=I: GO SUB 200: GO SUB 100: GO SUB 100: GO SUB 200: GO TO 20 100 FOR X=0 TO 255 105 PLOT X,0: DRAW 255-X,175: PLOT 255-X,175: DRAW X-255,-175 110 NEXT X 115 RETURN 200 FOR X=0 TO 255 205 PLOT X,175: DRAW 255-X,-175: PLOT 255-X,0: DRAW X-255,175 210 NEXT X 215 RETURN 9000 SAVE "MOIRE" ```