1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
rem Kalidescope
cls
print "Press Q to stop."
clg
screenx = 300
screeny = 300
maxsize = 100
fastgraphics
draw:
x = int(rand * screenx)
y = int(rand * screeny)
z = int(rand * maxsize) # size of box to draw on screen
colornumber = int(rand * 18)
gosub SETCOLOR
rect x, y, z, z
rect screenx - x - z, y, z, z # draw mirror reflection on x axis
rect x, screeny - y - z, z, z # draw mirror reflection on y axis
rect screenx - x - z, screeny - y - z, z, z # draw mirror reflestion on both
refresh
if key = asc("Q") then end # if user presses q then end
goto draw
end
SETCOLOR:
color int(rand*256), int(rand*256), int(rand*256)
return
|