Square Dance  -  Random pattern generation

by Martin Richards
RISC OS version by David Bradforth

SquareDance is an updated version of a program originally published for the BBC micro in BEEBUG magazine. It provides an attractive random graphic display based on coloured squares.

The program can be run from the RISC User menu system or by double-clicking on its icon in a directory viewer. When run, the screen clears and a pattern of repeating squares in different colours builds up on the screen. The squares appear to "dance" across the screen, hence the name of the application.

Pressing the space bar will restart the random generator, and a new set of squares will be generated using different forms and colours. Each time you press the space bar the screen will appear to show an entirely different effect.

If you want to leave the program running to provide an attractive abstract display, you can arrange for the pattern to change form randomly as well, instead of having to press the space bar. To do this, just locate the line near the end of the program that reads:
  UNTIL A=32
and replace it with:
  UNTIL TIME MOD 256=RND(255)

The complete program is listed in the Just-a-Page article in this month's RISC User magazine.

Copyright  RISC User 1994
