Code Sketch


wallArt
By: Sampada Dhupkar
Category: Art
cleari()

val bk = canvasBounds
setBackground(gray)

def sqr(n:Int) = Picture {
    setFillColor(black)
    setPenColor(green)
    setPenThickness(10)
    repeat(4) {
        forward(n)
        right(90)
    }
}

//val pics = picStackCentered(p(50), p(60))

def oct(n:Int) =Picture {
    setFillColor(yellow)
    setPenColor(green)
    setPenThickness(10)
    repeat(8){
        forward(n)
        right(45)
    }
}

def crl = Picture {
    setFillColor(red)
    setPenColor(blue)
    setPenThickness(10)
            right(360,100)
    }

val pics = picStackCentered(sqr(500), oct(160),crl)
def wallArt = picStack (pics, pics.withFlippedX,
pics.withFlippedY,pics.withTranslation(-500, -500))
draw(wallArt.withRotation(45))