One of the delights of the Oliger Video Upgrade for the T/S 1000 is being able to run programs intended for machines beyond normal ZX capabilities. Peter McMullin has shown this with his recent article using the Modulo function and a “Computer Recreations” column by A.K. Dewdney in the September Scientific American prints the outline of a similar program by John E. Connett creating “Wallpaper For the Mind”. Connett found that using the formula for the graph of a circle (X²+Y²) to assign a colour to the point X,Y. A complex pattern of circles emerges with an underlying pattern of squares. Thus the program is called “CIRCLE²”.
The patterns appear to repeat, but a closer look shows this is not so and each area is subtly different from its neighbors. Although the program is quite simple, I recommend reading the article. It has two more routines and wonderful photos with more background than be covered here.
This program is written for the Oliger system with Fred Nachbaur‘s “Jobasic” but a normal ZX using “Graphica” or the 2068 should handle it. The lines up to 10 are Jobasic initiallization and should be changed for your system. The “IF USR M2 THEN…” is also Jobasic syntax.
The variables CORNA, CORNB & SIDE define the lower left corner and side length of the part of the plane of numbers to be examined. In other words, a smaller SIDE “magnifies” the image.
Lines 30-90 evaluate X²+Y² through the loops and places the resulting integer in “C”. Line 100 tests C for “eveness” and line 110 plots the point if C is even. It might be interesting to assign colours to ranges of C. You are encouraged to experiment with the variables and the array size in lines 30 and 40. The figures in line 110 centre the display and should be changed to suit the array size.
Some examples to try are:
CORNA -15, CORNB -20, SIDE 87
CORNA -30, CORNB 5, SIDE 40
CORNA 20, CORNB -10, SIDE 20.



Sinc-Link Nov ’86
1 REM CIRCLE SQUARED
2 REM by Mel Richardson, Sinc-Link Dec'86
3 REM
4 REM lines 9,50,60,140 are for the 2068, or hi-res 1000
5 REM lines 51,61,141 are for the stock 1000
8 REM
9 PAPER 0: BORDER 0: INK 7: CLS
10 PRINT "cornA = ";
12 INPUT cornA
14 PRINT cornA;": ";
20 PRINT "cornB = ";
22 INPUT cornB
24 PRINT cornB;": ";
30 PRINT "Side = ";
32 INPUT side
34 PRINT side
40 REM 170 x 120 pixel display for 2068, 64 X 42 for 1000
50 REM FOR x=1 TO 170
51 FOR x=0 TO 64
60 REM FOR y=1 TO 120
61 FOR y=0 TO 41
70 LET i=cornA+(side*x/100)
80 LET j=cornB+(side*y/100)
90 LET k=i*i+j*j
100 LET c=INT k
110 REM
120 REM test for evenness
130 LET e=c/2-INT (c/2)
140 REM IF NOT e THEN PLOT x+40,y+36
141 IF NOT e THEN PLOT x,y
150 NEXT y
160 NEXT x
170 PRINT AT 23,0;"Z-copy R-restart"
180 IF INKEY$="" THEN GO TO 180
190 IF INKEY$="z" OR INKEY$="Z" THEN COPY
200 IF INKEY$="r" OR INKEY$="R" THEN RUN
210 GO TO 180
The above listing has been re-written from Mel Richardson‘s original. All references to Jobasic have been removed, and alternate lines for the 1000 and 2068 have been added. The 1000 version has not been tested, so there may be some de-bugging needed.
MF
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.