Code Sketch


Tree
By: Floyda Gonsalves
Category: Art
cleari()
showAxes()
showGrid()

def makeleaf(): Picture = {
    Picture.circle(50).withFillColor(green).thatsStrokeColored(green)
} 
val leaf1 = makeleaf()
val leaf2 = makeleaf().thatsTranslated(-50,-50)
val leaf3 = makeleaf().thatsTranslated(50,-50)
val leaf4 = makeleaf().thatsTranslated(0,-60)



def stem(): Picture = {
    Picture.rectangle(20,100).withFillColor(brown)
}
val bark = stem().thatsTranslated(-10,-200)


val tree = picStack(bark, leaf1, leaf2, leaf3, leaf4)
draw(tree)