0 REM KALEIDOT.BAS.txt - DZMBASIC Conversion of Kaleidoscope


20 DZOP "I"      : REM Initialize DAZZLER
30 DZOP "Z"      : REM Clear DAZZLER Screen
40 DZOP "C",1    : REM Set Color Mode (Multicolor)
50 RANDOMIZE

100 REM MAIN LOOP
110 FOR I = 1 TO 1000
120   REM Generate pseudo-random coordinates
130   X = INT(RND*256)
140   Y = INT(RND*256)

150   REM Pick a color from range 17 to 23 (excluding black)
160   COLOR = 17 + INT(RND*7)

170   REM Set color
180   DZOP "C", COLOR

190   REM Plot primary point
200   DZOP "P",X,Y : DZOP "D"

210   REM Plot symmetrical reflections (kaleidoscope effect)
220   DZOP "P",255-X,Y : DZOP "D"
230   DZOP "P",X,255-Y : DZOP "D"
240   DZOP "P",255-X,255-Y : DZOP "D"
250   DZOP "P",Y,X : DZOP "D"
260   DZOP "P",255-Y,X : DZOP "D"
270   DZOP "P",Y,255-X : DZOP "D"
280   DZOP "P",255-Y,255-X : DZOP "D"

290   REM Optional delay to see motion
300   DZOP "W",2
310 NEXT I

320 GOTO 100
