Code Sketch


Boat Tangram
By: Manjusha Govekar
cleari

//TangramTree

//showAxes()
//showGrid()


tangram.draw

def tangram = picStack(
    Picture {},
    
    square.thatsFilledWith(Color(0, 125, 44)).thatsRotated(45).thatsTranslated(05, 77),

    triangle1.thatsFilledWith(Color(205, 135, 52)).thatsRotated(45).withFlippedY.thatsTranslated(76, 77),

    triangle2.thatsFilledWith(red).thatsRotated(0).thatsTranslated(-100, 105),

    triangle2.thatsFilledWith(yellow).thatsRotated(-45-45).thatsTranslated(-100, 105),

    triangle3.thatsFilledWith(ColorMaker.hsl(297, 0.57, 0.49)).thatsRotated(-45).withFlippedX.thatsTranslated(5, 79.25),

    parallelogram.withFlippedX.thatsFilledWith(Color(0, 197, 103)).thatsRotated(-45).thatsTranslated(0, -70),

    triangle4.thatsFilledWith(Color(0, 122, 202)).thatsRotated(45).thatsTranslated(0, 0),

)


def square = Picture{
    right(135)
    forward(70.71)
    right(90)
    forward(70.71)
    right(90)
    forward(70.71)
    right(90)
    forward(70.71)
    right(90)
}.thatsStrokeColored(black)

def triangle1 = Picture{
    right()
    forward(100)
    left(135)
    forward(70.71)
    left(90)
    forward(70.71)   
}.thatsStrokeColored(black)

def triangle2 = Picture{
    right(135)
    forward(141.42)
    left(135)
    forward(200)
    left(135)
    forward(141.42)
}.thatsStrokeColored(black)

def triangle3 = Picture{
    left(45)
    forward(70.71)
    left(135)
    forward(100)
    left(135)
    forward(70.71)
}.thatsStrokeColored(black)

def parallelogram = Picture{
    forward(100)
    right(135)
    forward(70.71)
    right(45)
    forward(100)
    right(135)
    forward(70.71)
}.thatsStrokeColored(black)

def triangle4 = Picture {
    left(45)
    forward(141.42)
    left(135)
    forward(100)
    left(90)
    forward(100)
}.thatsStrokeColored(black)