Автор: Dave Trebilcock
Год: 1984
Издатели: Sinclair User
Языки:
Английский
Формат:
TAP лента
Требования:
ZX Spectrum 16K
Ссылки:
Страница на ZXArt
Страница на World Of Spectrum
Страница на Spectrum Computing
Скриншоты:
Год: 1984
Издатели: Sinclair User
Языки:
Формат:
Требования:
Ссылки:
Скриншоты:
CIRCLE PATTERNS
CIRCLE PATTERNS draws up to sixty different patterns based on the
CIRCLE command, which is used here in an unusual way. The patterns
generated look very like tesselating floor tiles and could be used
to good effect in title screens.
The program was written for the 16K Spectrum by D Trebilcock of Sale
in Cheshire.
Program Explanation
Variables:
col the number of the colour used
rad1 the radius of the inner circle
rad2 the radius of the outer circle
amend1 adjustment to the horizontal print position
amend2 adjustment to the vertical print position
dec size factor for the pattern
c control for FOR/NEXT loop
a,b hold data for print positions
Line 20 Sets ink to black and the rest of the screen to white.
Line 30 Sets the colour for the pattern at random.
Line 40 RESTORE tells the computer to start READing data from
a particular DATA statement - in this case at line 250.
Without the RESTORE command, when the program was
executed for a second time the computer would be unable
to find any more data to load.
Lines 60- 70 Set two different figures for a radius of the circle.
Depending on the size of each unit in the pattern, there
may be more than one circle in each unit.
Lines 80- 90 Set two separate figures for adjusting where each part
of the pattern is to be printed.
Line 100 Sets a factor for the size of the pattern units; 0, 1 or 2.
Line 110 The main loop of the program starts here. There are 23
units to be drawn.
Line 120 READs the print positions from DATA statements starting
at 250. When the first statement is used up the computer
moves automatically to the next.
Line 130 If the unit size is 1 or 2 the computer draws a small
circle. Normally with CIRCLE the circle is a curved line.
Here, because INK and PAPER colours are set the same, the
whole character square through which the circle passes is
set to one colour. This is a peculiarity of the Spectrum use
of colour which for once has been turned to good advantage.
Try changing either the INK or PAPER colours and see what
happens.
Line 140 If the unit size is 0 or 1 the computer draws a larger
circle, some of which may obliterate parts of the earlier
circle.
Line 150 INKEY$ checks to see if you are pressing the keyboard. In
this case, if you press "S" the program will STOP.
Line 160 The loop returns to line 110 to draw another unit.
Line 170- 180 The computer pauses to display the finished pattern and
then goes back to line 30 to set a new colour and draw a
new pattern.
Line 250- 260 DATA statements which contain the co-ordinates for
printing the pattern. The program will READ them two at
a time and then adjust them slightly for more variety. See
what happens if you alter a few of them.
CIRCLE PATTERNS draws up to sixty different patterns based on the
CIRCLE command, which is used here in an unusual way. The patterns
generated look very like tesselating floor tiles and could be used
to good effect in title screens.
The program was written for the 16K Spectrum by D Trebilcock of Sale
in Cheshire.
Program Explanation
Variables:
col the number of the colour used
rad1 the radius of the inner circle
rad2 the radius of the outer circle
amend1 adjustment to the horizontal print position
amend2 adjustment to the vertical print position
dec size factor for the pattern
c control for FOR/NEXT loop
a,b hold data for print positions
Line 20 Sets ink to black and the rest of the screen to white.
Line 30 Sets the colour for the pattern at random.
Line 40 RESTORE tells the computer to start READing data from
a particular DATA statement - in this case at line 250.
Without the RESTORE command, when the program was
executed for a second time the computer would be unable
to find any more data to load.
Lines 60- 70 Set two different figures for a radius of the circle.
Depending on the size of each unit in the pattern, there
may be more than one circle in each unit.
Lines 80- 90 Set two separate figures for adjusting where each part
of the pattern is to be printed.
Line 100 Sets a factor for the size of the pattern units; 0, 1 or 2.
Line 110 The main loop of the program starts here. There are 23
units to be drawn.
Line 120 READs the print positions from DATA statements starting
at 250. When the first statement is used up the computer
moves automatically to the next.
Line 130 If the unit size is 1 or 2 the computer draws a small
circle. Normally with CIRCLE the circle is a curved line.
Here, because INK and PAPER colours are set the same, the
whole character square through which the circle passes is
set to one colour. This is a peculiarity of the Spectrum use
of colour which for once has been turned to good advantage.
Try changing either the INK or PAPER colours and see what
happens.
Line 140 If the unit size is 0 or 1 the computer draws a larger
circle, some of which may obliterate parts of the earlier
circle.
Line 150 INKEY$ checks to see if you are pressing the keyboard. In
this case, if you press "S" the program will STOP.
Line 160 The loop returns to line 110 to draw another unit.
Line 170- 180 The computer pauses to display the finished pattern and
then goes back to line 30 to set a new colour and draw a
new pattern.
Line 250- 260 DATA statements which contain the co-ordinates for
printing the pattern. The program will READ them two at
a time and then adjust them slightly for more variety. See
what happens if you alter a few of them.