Code Sketch


house
By: Uma Mahendra Ekawade
Category: Art
cleari()


def triangle = Picture{
right()
forward(150)
left(120)
forward(150)
left(120)
forward(150)
}.thatsStrokeColored(black)


def smalltriangle = Picture{
 right()
forward(35)
left(120)
forward(35)
left(120)
forward(35)   
}.thatsStrokeColored(black)

def square = Picture{
left()
forward(150)
left()
forward(150)
left()
forward(150)
left()
forward(150)
}.thatsStrokeColored(black)

def smallsquare = Picture{
  left()
forward(35)
left()
forward(35)
left()
forward(35)
left()
forward(35)  
}.thatsStrokeColored(black)

def rectangle = Picture{
right()
forward(100)
right()
forward(50)
right()
forward(100)
right()
forward(50)
}.thatsStrokeColored(black)

def smallrectangle = Picture{
 right()
forward(40)
right()
forward(10)
right()
forward(40)
right()
forward(10)   
}.thatsStrokeColored(black)

def house = picStack(
    Picture{
square.thatsFilledWith(Color(255, 119, 40)).draw
triangle.thatsFilledWith(brown).thatsTranslated(-150, 0).draw
rectangle.thatsFilledWith(brown).thatsRotated(90).thatsTranslated(-100, -150).draw   
smallsquare.thatsFilledWith(brown).thatsTranslated(-10, -70).draw
smallsquare.thatsFilledWith(brown).thatsTranslated(-110, -70).draw
smallrectangle.thatsTranslated(-90, 40).thatsFilledWith(green).draw
smalltriangle.thatsTranslated(-45, -105).draw
smalltriangle.thatsTranslated(-145, -105).draw    
        
        }
   
    
    
    
    
    )
house.draw