Code Sketch


Teddy bear
By: Shanon Cherilyn Pereira
Category: Programming
cleari()
setSpeed(superFast)

def myColor1 = (207, 154, 144, 255)
def myColor2 = (172, 154, 172, 255)

val Color1 = cm.linearGradient(-79, 105, ColorMaker.hsl(342, 0.81, 0.58), 65, -73, ColorMaker.hsl(300, 0.96, 0.18), true) 

setBackground (Color1)
setPenColor(black)

def shape (steps:Long, size:Double, side:Long)
{
    if (steps == 0)
    {
        
    }
    else
    {
        forward(size)
        right(360/side)
        shape(steps-1,size,side)
    }
}

def teddyBearBody
{
    setFillColor(cm.saddleBrown)
    setPosition (-10, 75)
    right()
    shape(360,2,360)
    setPosition (-50, 75)
    left(135)
    shape(360,1.2,360)
}

def teddyBearHandsAndLegs
{   
    setPenColor(Color(207, 154, 114))
    setFillColor(cm.saddleBrown)
    setPosition(60, -20)
    shape(360, 0.7, 360)
    setPosition(-130, -20)
    shape(360, 0.7, 360)
    setPosition(-130, -150)
    shape(360, 0.8, 360)
    setPosition(45, -150)
    shape(360, 0.8, 360)
}

def teddyBearEyes
{
    setPenColor(black)
    setFillColor(black)
    setPosition(15, 135)   
    shape(360, 0.1, 360) 
    setPosition(-30, 135)   
    shape(360, 0.1, 360)
}

def teddyBearFace
{
    setPenColor(black)
    setFillColor(noColor)
    setPosition (-33, 95)
    right(180)
    left(90,45)   
    setPosition(-8, 120)
    setFillColor(black)
    shape(360, 0.1, 360)
}

def teddyBearEars
{
    setPenColor(black)
    setFillColor(cm.saddleBrown)
    setPosition(-102, 175)
    shape(360, 0.6,360)
    setPosition(23, 175)
    shape(360, 0.6,360)
}

def TeddyBear
{
    teddyBearEars
    teddyBearBody
    teddyBearHandsAndLegs
    teddyBearEyes
    teddyBearFace
}

def Text
{
    penUp()
    home()
    setPosition(-169, -189)
    penDown()
    setPenColor(gray)
    setPenFont(Font("Cambria", 25))
    write("Shanon Pereira and Simran Bonsle")
    penUp()
    setPosition(-172, -186)
    setPenColor(white)
    setPenFont(Font("Cambria", 25))
    penDown()
    write("Shanon Pereira and Simran Bonsle")
    
  
}

TeddyBear
Text