Posted: 30th Jan 2017 8:44
A spyrograph code.
It is random, but can be easily modified to fit any specified purpose.
Sorry, the variable names are un Portuguese, but I commented all of the code in English for the sake of this community.
Enjoy!

+ Code Snippet
//spyrograph by Emir Starshyne
//just for fun, but someone may find it useful


//change these values to fit your resolution
set display mode 1366,768,32

//fake fullscreen
maximize window
set window layout 0,0,0

//neet these two as floats
vel1 as float
vel2 as float

//main loop
do
cls

//circumference size
circunferencia = rnd(250)+150

//disc size
disco = rnd(125)+25

//speeds for rotation
vel1 = rnd(19)+1
vel2 = vel1 / rnd(vel1*2)

//setting the center
x = screen width()/2
y = screen height()/2

//to avoid the first point to be wrongly placed
start = 0


//the magic happens in here
repeat

//rotates the spyrograph
rotacao = wrapvalue(rotacao+vel1)       
rotacaodisco = wrapvalue(rotacaodisco+vel2)

//calculates the position of the disc and the pen
cx = x + sin(rotacao)*circunferencia
cy = y + cos(rotacao)*circunferencia
dx = cx + sin(rotacaodisco)*disco
dy = cy + cos(rotacaodisco)*disco

//check if it started, a workaround
if start = 0
adx = dx
ady = dy
start = 1
endif

//the pen draws the form here
line adx,ady,dx,dy

//store the previous position into memory to keep on drawing
adx = dx
ady = dy

//if spacekey is pressed, generate another spyrograph setting       
UNTIL spacekey() = 1
loop