Code Sketch


123
By: Pratisha Lotlikar
cleari

//showAxes()
//showGrid()


tangram.draw

def tangram = picStack(
    Picture {},
    square.thatsFilledWith(Color(242, 80, 17))thatsRotated(45)thatsTranslated(40, 0),
    triangle1.thatsFilledWith(Color(226, 234, 32)).thatsRotated(585).thatsTranslated(40, 0),
    triangle2.thatsFilledWith(Color(236, 7, 35)).thatsRotated(405),
    triangle2.thatsFilledWith(Color(255, 73, 242)).thatsRotated(135),
    triangle3.thatsFilledWith(ColorMaker.hsl(123, 0.74, 0.47)).thatsRotated(585).thatsTranslated(-100, -70),
    parallelogram.thatsFilledWith(Color(57, 26, 236)).thatsTranslated(50, 95),
    triangle4.thatsFilledWith(Color(60, 230, 224)).thatsRotated(45).thatsTranslated(40, 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(Color(242, 80, 17))

def triangle1 = Picture{
    right()
    forward(100)
    left(135)
    forward(70.71)
    left(90)
    forward(70.71)   
}.thatsStrokeColored(Color(226, 234, 32))

def triangle2 = Picture{
    right(135)
    forward(141.42)
    left(135)
    forward(200)
    left(135)
    forward(141.42)
}.thatsStrokeColored(Color(255, 73, 242))

def triangle3 = Picture{
    left(45)
    forward(70.71)
    left(135)
    forward(100)
    left(135)
    forward(70.71)
}.thatsStrokeColored(ColorMaker.hsl(123, 0.74, 0.47))

def parallelogram = Picture{
    forward(100)
    right(135)
    forward(70.71)
    right(45)
    forward(100)
    right(135)
    forward(70.71)
}.thatsStrokeColored(Color(57, 26, 236))

def triangle4 = Picture {
    left(45)
    forward(141.42)
    left(135)
    forward(100)
    left(90)
    forward(100)
}.thatsStrokeColored(Color(60, 230, 224))