Code Sketch


assignment3
By: arya Dhavalikar
cleari

//showAxes()
//showGrid()


def shape3 = Picture{
    right(135)
    forward(70.71)
    right(90)
    forward(70.71)
    right(90)
    forward(70.71)
    right(90)
    forward(70.71)
    right(90)
}.thatsStrokeColored(noColor)

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

def shape1 = Picture{
    right(135)
    forward(141.42)
    left(135)
    forward(200)
    left(135)
    forward(141.42)
}.thatsStrokeColored(noColor)

def shape5 = Picture{
    left(45)
    forward(70.71)
    left(135)
    forward(100)
    left(135)
    forward(70.71)
}.thatsStrokeColored(noColor)

def shape6 = Picture{
    forward(100)
    right(135)
    forward(70.71)
    right(45)
    forward(100)
    right(135)
    forward(70.71)
}.thatsStrokeColored(noColor)

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

def square = picStack(
    Picture {},
      shape1.thatsRotated(90).thatsTranslated(0, 100).thatsFilledWith(cm.orange),
    shape1.thatsRotated(0).withFlippedY.thatsTranslated(0, 100).thatsFilledWith(cm.yellow),
    shape4.thatsRotated(-90).thatsTranslated(-100, 200).thatsFilledWith(green),
   shape3.thatsTranslated(-50, 150).thatsFilledWith(ColorMaker.hsl(164, 1.00, 0.50)),
    shape5.thatsRotated(90).thatsTranslated(0, 100).thatsFilledWith(ColorMaker.hsl(142, 0.95, 0.37)),
    shape6.withFlippedX.thatsRotated(90).thatsTranslated(50, 50).thatsFilledWith(ColorMaker.hsl(120, 0.74, 0.19)),
    shape7.thatsTranslated(0,0).thatsFilledWith(red),
    
)


def tan1 = picStack(
    Picture {},
      shape1.withFlippedX.thatsTranslated(0, 100).thatsFilledWith(cm.orange),
    shape1.thatsRotated(135).thatsTranslated(-100, 30).thatsFilledWith(cm.yellow),
    shape4.thatsRotated(-135).withFlippedX.thatsTranslated(-100, 270).thatsFilledWith(green),
   shape3.thatsTranslated(0, 100).thatsFilledWith(ColorMaker.hsl(164, 1.00, 0.50)),
    shape5.thatsRotated(90).thatsTranslated(-50, 50).thatsFilledWith(ColorMaker.hsl(142, 0.95, 0.37)),
    shape6.thatsRotated(45).thatsTranslated(-140, -70).thatsFilledWith(ColorMaker.hsl(120, 0.74, 0.19)),
    shape7.thatsRotated(45).thatsTranslated(0,0).thatsFilledWith(red),
    
)

def tan2 = picStack(
    Picture {},
      shape1.thatsRotated(90).thatsTranslated(0, 0).thatsFilledWith(cm.orange),
    shape1.thatsRotated(90).thatsTranslated(0, 100).thatsFilledWith(cm.yellow),
    shape4.thatsRotated(-90).withFlippedX.thatsTranslated(0, 0).thatsFilledWith(green),
   shape3.thatsTranslated(-100, 30).thatsFilledWith(ColorMaker.hsl(164, 1.00, 0.50)),
    shape5.thatsTranslated(50, -50).thatsFilledWith(ColorMaker.hsl(142, 0.95, 0.37)),
    shape6.thatsRotated(45).thatsTranslated(-100, 30).thatsFilledWith(ColorMaker.hsl(120, 0.74, 0.19)),
    shape7.withFlippedX.thatsTranslated(0,100).thatsFilledWith(red),
    
)

def tan3 = picStack(
    Picture {},
      shape1.thatsRotated(-45).withFlippedX.thatsTranslated(0, 0).thatsFilledWith(cm.orange),
    shape1.thatsRotated(45).withFlippedX.thatsTranslated(0, 0).thatsFilledWith(cm.yellow),
    shape4.thatsRotated(45).thatsTranslated(70, -35).thatsFilledWith(green),
   shape3.thatsRotated(45).thatsTranslated(0, 35).thatsFilledWith(ColorMaker.hsl(164, 1.00, 0.50)),
    shape5.thatsRotated(90).thatsTranslated(-140, 0).thatsFilledWith(ColorMaker.hsl(142, 0.95, 0.37)),
    shape6.thatsRotated(90).thatsTranslated(-190, -50).thatsFilledWith(ColorMaker.hsl(120, 0.74, 0.19)),
    shape7.withFlippedX.thatsTranslated(40,35).thatsFilledWith(red),
    
)
def tan4 = picStack(
    Picture {},
      shape1.withFlippedX.thatsTranslated(-0, 100).thatsFilledWith(cm.orange),
    shape1.withFlippedX.thatsTranslated(130, 100).thatsFilledWith(cm.yellow),
    shape4.thatsRotated(45).thatsTranslated(70, -70).thatsFilledWith(green),
   shape3.thatsRotated(45).thatsTranslated(0, 0).thatsFilledWith(ColorMaker.hsl(164, 1.00, 0.50)),
    shape5.thatsRotated(-45).thatsTranslated(0, -70).thatsFilledWith(ColorMaker.hsl(142, 0.95, 0.37)),
    shape6.thatsRotated(45).thatsTranslated(-140, -70).thatsFilledWith(ColorMaker.hsl(120, 0.74, 0.19)),
    shape7.thatsRotated(45).thatsTranslated(0,0).thatsFilledWith(red),
    
)

def tan5 = picStack(
    Picture {},
      shape1.thatsRotated(-90).thatsTranslated(-0, 100).thatsFilledWith(cm.orange),
    shape1.thatsRotated(90).thatsTranslated(-100, 0).thatsFilledWith(cm.yellow),
    shape4.thatsRotated(45).thatsTranslated(240, -1).thatsFilledWith(green),
   shape3.thatsRotated(45).thatsTranslated(-130, 170).thatsFilledWith(ColorMaker.hsl(164, 1.00, 0.50)),
    shape5.thatsRotated(-45).thatsTranslated(240, 0).thatsFilledWith(ColorMaker.hsl(142, 0.95, 0.37)),
    shape6.thatsRotated(45).thatsTranslated(100, 0).thatsFilledWith(ColorMaker.hsl(120, 0.74, 0.19)),
    shape7.thatsRotated(45).thatsTranslated(240,70).thatsFilledWith(red),
    
)

def tan6 = picStack(
    Picture {},
      shape1.thatsRotated(180).withFlippedX.thatsTranslated(0, 0).thatsFilledWith(cm.orange),
    shape1.thatsRotated(180).thatsTranslated(200, 0).thatsFilledWith(cm.yellow),
    shape4.thatsRotated(180).thatsTranslated(0, 0).thatsFilledWith(green),
   shape3.thatsTranslated(-130, 70).thatsFilledWith(ColorMaker.hsl(164, 1.00, 0.50)),
    shape5.thatsRotated(90).thatsTranslated(0, 0).thatsFilledWith(ColorMaker.hsl(142, 0.95, 0.37)),
    shape6.thatsRotated(90).thatsTranslated(200, 100).thatsFilledWith(ColorMaker.hsl(120, 0.74, 0.19)),
    shape7.thatsRotated(-135).thatsTranslated(-40,100).thatsFilledWith(red),   
)

def tan7 = picStack(
    Picture {},
      shape1.thatsRotated(90).withFlippedY.thatsTranslated(0, 0).thatsFilledWith(cm.orange),
    shape1.thatsRotated(90).thatsTranslated(100, -100).thatsFilledWith(cm.yellow),
    shape4.thatsRotated(0).thatsTranslated(-100,0).thatsFilledWith(green),
   shape3.thatsTranslated(-50, 150).thatsFilledWith(ColorMaker.hsl(164, 1.00, 0.50)),
    shape5.thatsRotated(135).withFlippedX.thatsTranslated(-100, -30).thatsFilledWith(ColorMaker.hsl(142, 0.95, 0.37)),
    shape6.thatsRotated(45).thatsTranslated(-171, -100).thatsFilledWith(ColorMaker.hsl(120, 0.74, 0.19)),
    shape7.thatsRotated(-90).thatsTranslated(-100,-100).thatsFilledWith(red),   
)

def tan8 = picStack(
    Picture {},
      shape1.thatsRotated(-90).withFlippedY.thatsTranslated(0, 0).thatsFilledWith(cm.orange),
    shape1.thatsRotated(-90).thatsTranslated(100, 100).thatsFilledWith(cm.yellow),
    shape4.thatsRotated(90).thatsTranslated(-100,00).thatsFilledWith(green),
   shape3.thatsTranslated(150, 150).thatsFilledWith(ColorMaker.hsl(164, 1.00, 0.50)),
    shape5.thatsRotated(-90).withFlippedX.thatsTranslated(200, 100).thatsFilledWith(ColorMaker.hsl(142, 0.95, 0.37)),
    shape6.thatsRotated(-90).withFlippedX.thatsTranslated(200, 0).thatsFilledWith(ColorMaker.hsl(120, 0.74, 0.19)),
    shape7.thatsRotated(-90).withFlippedY.thatsTranslated(-100,100).thatsFilledWith(red),   
)
tan1.thatsTranslated(-550, 400).thatsScaled(.4).draw
tan2.thatsTranslated(-550, 0).thatsScaled(.4).draw
tan3.thatsTranslated(-550, -350).thatsScaled(.4).draw
tan4.thatsTranslated(-150, -350).thatsScaled(.4).draw
tan5.thatsTranslated(230, -400).thatsScaled(.4).draw
tan6.thatsTranslated(750, -350).thatsScaled(.4).draw
tan7.thatsTranslated(700, 100).thatsScaled(.4).draw
tan8.thatsTranslated(600, 400).thatsScaled(.4).draw
square.thatsTranslated(0, 0).draw
setBackgroundH(blue, purple)


def text = Picture{
      
setPenFont(Font("Lucida Calligraphy",60))
write("Tengram Shapes")
}
text.thatsTranslated(-220, 300).draw