Code Sketch
Illusion
By: Soham Dabral
Category: Art
2


0




def triangle(size: Double) = Picture { left(5) forward(size) right(92) forward(size / 10) right(94) forward(size) } def illusion(n: Int, size: Double): Picture = { if (n == 1) { triangle(size) } else { picStack( penColor(noColor) * fillColor(black) -> triangle(size), penColor(noColor) * rot(9) -> illusion(n - 1, size) ) } } cleari() clearOutput() val bgclr = cm.radialGradient(0, 0, cm.gray, 80, cm.white, false) setBackground(bgclr) draw(illusion(42, 200))





Your Comment:





Login to post a comment