# Doodle Insights #20: The Twisting 4-Sided Column Effect

`function _draw() cls() local a=time()*0.2 for i=0,0.75,0.25 do  local x1=64+32*cos(a+i)  local x2=64+32*cos(a+i+0.25)   if x1>x2 then   rectfill(x1,0,x2,127,7)   rect(x1,0,x1,127,0)   rect(x2,0,x2,127,0)  end endend`
`local x1=64+32*cos(a+i)local x2=64+32*cos(a+i+0.25)`
`function _draw() cls() local t=time()/2  for y=0,127 do  local yy=y/1024  local a=cos(0.2*sin(t*0.1+yy*2))+0.5*cos(-0.2*t+yy/2)   for i=0,0.75,0.25 do   local x1=64+32*cos(a+i)   local x2=64+32*cos(a+i+0.25)    if x1>x2 then    rect(x1,y,x2,y,7)    pset(x1,y,0)    pset(x2,y,0)   end  end endend`
`plt={0,1,2,8,14,15,7}fillp(0b0101010101010101)function _draw() cls() local t=time()/2 for y=0,127 do  local yy=y/1024  local a=cos(0.2*sin(t*0.1+yy*2))+0.5*cos(-0.2*t+yy/2)   for i=0,0.75,0.25 do   local x1=64+32*cos(a+i)   local x2=64+32*cos(a+i+0.25)    if x1>x2 then    local c=(x1-x2)/(1.5*32)*#plt+1    local ca=plt[flr(c)]    local cb=plt[min(flr(c+0.5),#plt)]    rect(x1,y,x2,y,ca+cb*16)   end  end endend`
`0b 0 1 0 1   0 1 0 1   0 1 0 1   0 1 0 1`
`function _draw() cls() local t=time()/2 for y=0,127 do  local yy=y/1024  local a=cos(0.2*sin(t*0.1+yy*2))+0.5*cos(-0.2*t+yy/2)  local w=32+4*(sin(-t+y/128)+0.5*cos(0.5*t-y/64))  local x=64+16*cos(sin(t*0.1+yy*2))   for i=0,0.75,0.25 do   local x1=x+w*cos(i+a)   local x2=x+w*cos(i+a+0.25)    if x1>x2 then    local c=(x1-x2)/(1.5*w)*#plt+1    local ca=plt[flr(c)]    local cb=plt[min(flr(c+0.5),#plt)]     rect(x1,y,x2,y,ca+cb*16)   end  end endend`
`local x1=64+32*cos(a+i)local x2=64+32*cos(a+i+0.25)--becomeslocal x1=x+w*cos(i+a)local x2=x+w*cos(i+a+0.25)`

--

--

Makes video games and colorful experiments and writes about mostly the latter! Please check out my patreon at https://patreon.com/trasevol_dog

Love podcasts or audiobooks? Learn on the go with our new app.

## TRASEVOL DOG

Makes video games and colorful experiments and writes about mostly the latter! Please check out my patreon at https://patreon.com/trasevol_dog