Colors From Taiwan (GRAPHICS 11 Demo)

Type
Graphics
Category
GTIA 16-hue line-art demo
Author
Masahiro Mori (multicolour version suggested by the Antic editors)
Published in
Antic, March 1984 (Vol. 2, No. 12), I/O Board letters page
Year
1984
Language
Atari BASIC
Requirements
GTIA chip (any XL/XE, or a 400/800 with GTIA), 16K RAM, Atari BASIC
Two GRAPHICS 11 screens side by side: on the left a bow-tie shape of thin orange horizontal lines; on the right a diamond of thin lines striped in blue, purple, red and orange

About the program

"I have designed a GTIA program with colors and a beautiful design. You can put this program in ANTIC magazine." That was the whole of Masahiro Mori's letter from Taichung, Taiwan, printed on Antic's I/O Board in March 1984 under the heading "Colors From Taiwan". The editors added a two-line change to make a multicoloured version, and both went on the monthly disk as TAIWAN.BAS and TAIWAN2.BAS. Mori soon became one of the magazine's youngest regular contributors, with programs such as Three Color Demo and Mole Attack.

What you need

GRAPHICS 11 is a GTIA mode, so you need any XL or XE, or a 400/800 fitted with the GTIA chip.

Typing it in

Both listings are plain text. TAIWAN2.BAS differs only in lines 5, 30 and 35. Each runs for ever and starts a new pattern after every pass, so press BREAK to stop.

How it works

  • GRAPHICS 11 gives 80 × 192 pixels in up to 16 hues at a single brightness. COLOR Z chooses the hue, from 1 to 9 here.
  • Each pass runs I from 1 to 79 while X moves down the screen two lines at a time. Line 40 draws a horizontal line from I to 79-I at row X, and line 50 mirrors it at row 190-X. The lines get shorter towards the middle of the loop and longer again after it (once I passes 40 the line is drawn right to left), which gives the bow-ties and diamonds.
  • X is never reset, only wrapped back to 0 at the bottom (line 60). So each new pass starts at a different height and the pattern changes every time.
  • TAIWAN.BAS changes the hue once per pass (Z=Z+1 in line 70).
  • TAIWAN2.BAS adds 1 to Z for every line (line 30), so the pattern is striped through nine hues.

Variations to try

  • Change IF Z>9 to IF Z>15 to use all fifteen hues.
  • Change X=X+2 to X=X+1 for solid shapes instead of fine lines.

Listings

TAIWAN.BAS:

5 Z=1
10 GRAPHICS 11
20 FOR I=1 TO 79
30 COLOR Z:IF Z>9 THEN Z=1:COLOR Z
40 PLOT I,X:DRAWTO 79-I,X
50 PLOT I,190-X:DRAWTO 79-I,190-X
60 X=X+2:IF X>190 THEN X=0
70 NEXT I:Z=Z+1:GOTO 10

TAIWAN2.BAS (multicolour version):

5 Z=0
10 GRAPHICS 11
20 FOR I=1 TO 79
30 Z=Z+1:IF Z>9 THEN Z=1
35 COLOR Z
40 PLOT I,X:DRAWTO 79-I,X
50 PLOT I,190-X:DRAWTO 79-I,190-X
60 X=X+2:IF X>190 THEN X=0
70 NEXT I:Z=Z+1:GOTO 10

Download

The original program from the Antic disk, to LOAD or ENTER instead of typing it: TAIWAN.BAS, TAIWAN2.BAS.

Credits