Code Sketch


rabbit
By: Uma Mahendra Ekawade
Category: Programming
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(black)

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

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

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

def shape6 = Picture{
    forward(50)
    right(135)
    forward(70.71)
    right(45)
    forward(50)
    right(135)
    forward(70.71)
}.thatsStrokeColored(black)

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

def tangram = picStack(
    Picture {},
    
   shape1.withFlippedX.thatsRotated(135).thatsTranslated(-140, 0).thatsFilledWith(Color(255, 78, 44)),
   shape1.thatsRotated(135).thatsFilledWith(Color(247, 19, 226)),
   shape7.thatsFilledWith(yellow).withFlippedX.thatsRotated(0).thatsTranslated(-140,-142),
   shape4.thatsFilledWith(green).thatsRotated(90).withFlippedX.thatsTranslated(-40, -142),
   shape5.thatsFilledWith(blue).thatsTranslated(50, 0),
   shape3.thatsFilledWith(red).thatsRotated(135).thatsTranslated(0, 130),
   shape6.thatsFilledWith(yellow).thatsTranslated(0.0, 250).thatsRotated(15),
 )
tangram.draw