Code Sketch


Garden and boy
By: chinar
Category: Art
cleari()
setSpeed(fast)
setPosition(-430,-300)
setFillColor(cyan)
repeat(2){
    forward(600)
    right
    forward(850)
    right()
}
setFillColor(Color(247, 247, 21))
setPosition(370,180)
circle(50)
right()
setPenColor(yellow)
setPenThickness(5)
forward(30)
hop(-30)
right()
hop(20)
left(70)
forward(30)
hop(-30)
right(110)
hop(20)
left()
forward(30)
hop(-30)
right(110)
hop(20)
left()
forward(30)
hop(-30)
right(110)
hop(20)
left()
forward(30)
hop(-30)
right(110)
hop(20)
left()
forward(30)
hop(-30)
right(110)
hop(20)
left()
forward(30)
hop(-30)
right(110)
hop(20)
left()
forward(30)
hop(-30)
right(110)
hop(20)
left()
forward(30)
hop(-30)
right(110)
hop(20)
left()
forward(30)
hop(-30)
right(110)
hop(20)
left()
forward(30)
hop(-30)
right(110)
hop(20)
left()
forward(30)
hop(-30)
right(110)
hop(20)
left()
forward(30)
hop(-30)
right(110)
hop(20)
left()
forward(30)
hop(-30)
right(110)
hop(20)
left()
forward(30)
hop(-30)
right(110)
hop(20)
left()
forward(30)
hop(-30)
right(110)
hop(20)
left()
forward(30)
hop(-30)
right(110)
hop(20)
left()
forward(30)
setPosition(290,210)
turnNorth()
setPenColor(black)
setPenFontSize(40)
write("sun");setPosition(-430,-200);setPenColor(Color(20, 185, 20));setFillColor(Color(9, 192, 82));right(100,110);forward(731)
turnSouth()
forward(80);right();forward(850)
turnNorth();forward(100);right(100,110);turnEast();forward(720);right();forward(200)
setPosition(-100,80)
turnNorth()
def branch(n: Double) {
    forward(n)
}

def tree(n: Double) {
    savePosHe()
    setPenColor(cm.rgb(n.toInt, math.abs(255 - n * 3).toInt, 125))
    if (n <= 4) {
        setPenThickness(0.5)
        branch(n / 2)
    }
    else {
        setPenThickness(n / 7)
        branch(n)
        right(25)
        tree(0.8 * n - 2)
        left(25)
        left(20)
        tree(n - 10)
    }
    restorePosHe()
}

hop(-200)
tree(90)
setPosition(80,-250)
setPenColor(black)
setFillColor(red)
forward(50)
right()
forward(70)

right()
forward(50)
right()
forward(25)
right(70)
forward(30);left(140);forward(30);turnWest();forward(25)
setFillColor(black)
left(20);forward(20);left();forward(20);left();forward(45);left();forward(12)

penUp()
left();forward(33);right();back(2)
penDown()
setPenColor(white)
forward(8)
penUp()
back(8);right();forward(7);left()
penDown()
forward(10)
setPosition(125,-250)
left(120)
setPenColor(black)
forward(30);left();forward(20);left(92);forward(47)
setPenColor(white)
penUp()
left(160);forward(25);right(55)
penDown()
forward(10)

penUp()
back(10);left();forward(8);right();forward(3)
penDown()
forward(8)
setFillColor(noColor)
setPosition(80,-200)
turnNorth()
setFillColor(ColorMaker.hsl(0, 0.00, 0.41))
forward(50);right(60);forward(80);turnSouth;forward(90);right();forward(70)

penUp()
right();forward(50)
penDown()
left(120)
forward(50)
right();forward(25);right();forward(110);right(90,25)
setPosition(25,-155);hop(12);right(190);setFillColor(orange);circle(20);setFillColor(Color(109, 109, 109))
hop(-10);right(90)
hop(10);right(15);forward(37)
left();forward(17)
setPosition(100,-110)
setFillColor(orange)
setPenColor(black)
forward(20)
left();forward(10);right(110,5);left(70,5);right(110,5);forward(10);back(13)
left(100)
right(90,5);left(90);forward(5);left(90);forward(7);right(145,3)
right(35);forward(10);left(50);left(30,10);forward(7);right(100,10);forward(20)
right(100,30);forward(5);right(60,40);turnSouth()
forward(10)
right(60);forward(25)

setPosition(90,-45)
setFillColor(white)
turnNorth()
circle(7)
setPosition(87,-45)
setFillColor(black)

circle(4)
setPosition(65,-36)
setFillColor(black)
forward(10);right(90,20);forward(30);right(80,10);forward(20)
setPosition(-70,-200)
turnNorth()
setFillColor(pink)
setPenThickness(3)
repeat(5){
    setPenColor(randomColor)
    repeat(1){
        circle(10)
    }
    right(360/5)
}
setPenColor(Color(88, 58, 10, 155))
setPenThickness(6)

back(40)
hop(40)
right()
hop(5)
left()
setFillColor(white)
setPenColor(white)
circle(5)