# Untitled

December 29 2008 at 3:52 PM

DECLARE SUB kaleido (z%)

DECLARE SUB mirror (a AS INTEGER, b AS INTEGER, x AS INTEGER, y AS INTEGER)

DEFINT A-Z

DIM SHARED qsize AS INTEGER, qpntr AS INTEGER

DIM SHARED qx(5000) AS INTEGER, qy(5000) AS INTEGER

DIM SHARED stepsize AS INTEGER

SCREEN 12

stepsize = 5

hue = 15

DO

IF RND(1) < .01 THEN hue = INT(RND(1) * 15) + 1

CALL kaleido(hue)

IF INKEY\$ = CHR\$(27) THEN END

LOOP

SUB kaleido (z)

qsize = 5000

previndex = (qpntr - 1 + qsize) MOD qsize

newx = qx(previndex) + INT(RND(1) * (2 * stepsize + 1)) - stepsize

newx = newx - INT(RND(1) * (newx + 1)) / 175

IF (newx < 0) THEN newx = 0

IF (newx > 319) THEN newx = 319

newy = qy(previndex) + INT(RND(1) * (2 * stepsize + 1)) - stepsize

newy = newy - INT(RND(1) * (newy + 1)) / 175

IF (newy < 0) THEN newy = 0

IF (newy > 319) THEN newy = 319

COLOR 0

oldindex = (qpntr + 1) MOD qsize

CALL mirror(qx(oldindex), qy(oldindex), qx(qpntr), qy(qpntr))

COLOR z

CALL mirror(qx(previndex), qy(previndex), newx, newy)

qx(qpntr) = newx

qy(qpntr) = newy

qpntr = oldindex

END SUB

SUB mirror (a AS INTEGER, b AS INTEGER, x AS INTEGER, y AS INTEGER)

LINE (320 + a, 240 + b)-(320 + x, 240 + y)

LINE (319 - a, 239 - b)-(319 - x, 239 - y)

LINE (319 - a, 240 + b)-(319 - x, 240 + y)

LINE (320 + a, 239 - b)-(320 + x, 239 - y)

LINE (320 + b, 240 + a)-(320 + y, 240 + x)

LINE (319 - b, 239 - a)-(319 - y, 239 - x)

LINE (319 - b, 240 + a)-(319 - y, 240 + x)

LINE (320 + b, 239 - a)-(320 + y, 239 - x)

END SUB

 Respond to this message
 Current Topic - Untitled