Code Sketch


vedika kumbhar
By: Mhalsakant School
Category: Art
 val filter = new com.jhlabs.image.NoiseFilter
val star = Picture {
    repeat(5) {
        forward(10)
        right(145)
        forward(10)
        left(74)
    }
}
    //.withRotation(-10)
    .withPenColor(noColor)
    .withFillColor(pink)
    //.withEffect(filter)


def stars(n: Int): Picture = {
    if (n <= 10) {
        star
    }
    else {

        picStack(
            star,
            stars(n - 1).withScaling(1.15).withTranslation(20, 0)
        )
    }
}
val colStar = stars(15)
def cirStar(n: Int): Picture = {
    if (n <= 0) {
        colStar
    }
    else {
        picStack(
            colStar,
            cirStar(n - 12).withRotation(30)
        )
    }
}

cleari
draw(cirStar(360))