Code Sketch


dog
By: Leann D. John
Category: Art
clear()
setSpeed(fast)
showAxes()
showGrid()
setPenThickness(20)

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

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

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 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 dog = picStack(
    Picture {},
    shape3.thatsRotated(-45)
    .thatsFilledWith(green),
    
    shape1.thatsRotated(43)
    .thatsTranslated(-70,0)
    .thatsFilledWith(yellow),
    
    shape1.thatsRotated(225)
    .thatsTranslated(140,70)
    .thatsFilledWith(color(255,0,0)),
    
    shape4.thatsRotated(135)
    .thatsTranslated(140,-70)
    .thatsFilledWith(color(116,98,187)),
    
   shape4.thatsRotated(20)
    .thatsTranslated(140,70)
    .thatsFilledWith(orange),

      shape6.withFlippedX.thatsRotated(-135)
      .thatsScaled (0.7)
      .thatsTranslated(-119,140)
      .thatsFilledWith(color(255,0,0)),

      shape5.thatsRotated(90)
      .thatsTranslated(-119,140)
      .thatsFilledWith(color(0,54,246))
 )
  ;dog
  .draw