Code Sketch


Gen-art #2 created by Aditya Pant
By: Anusha Pant
cleari()
size(900, 900)
def initRandom() {
    initRandom(randomLong)
}

def initRandom(seed: Long) {
    println(seed)
    setRandomSeed(seed)
}

initRandom(-4518227653342106580L)
//initRandom(-4084058479965099892L)

val pic1 = Picture {
    def shape() {
        repeat(2) {
            forward(50)
            right(90)
            forward(20)
            left(90)
            forward(30)
            right(90)
            forward(20)
            right(90)
        }
    }
    def shape2() {
        repeat(2) {
            forward(50)
            right(-90)
            forward(20)
            left(-90)
            forward(30)
            right(-90)
            forward(20)
            right(-90)
        }

    }
    def block() {
        shape()
        shape2()
        right(20)
    }
    setPenColor(randomColor.fadeOut(0.6))
    setFillColor(randomColor.fadeOut(0.6))
    setAnimationDelay(0)
    repeat(18) {
        block()
    }
}

val pic2 = Picture {
    setPenFont(Font("Noto Serif", 70, BoldFont | ItalicFont))
    setPenColor(darkGray)
    write("Never Give Up")
}

val gap = Picture {
    setPenColor(noColor)
    repeat(4) {
        forward(30)
        right(90)
    }
}

val pic = scale(1.2) -> picColCentered(pic2, gap, scale(3.1) -> pic1)

drawCentered(pic)