Code Sketch
Smiling Flower
clear()
setSpeed(fast)
def circle = {
Picture.circle(70)
}
def arc = {
Picture.arc(100,100)
}
/////////////////////////////////
///// Red Flower
def redPetals = picStack (
Picture{},
circle
.thatsFilledWith(red)
.thatsStrokeColored(yellow)
.thatsTranslated(40,105)
.thatsStrokeSized(4),
circle
.thatsFilledWith(red)
.thatsStrokeColored(yellow)
.thatsTranslated(-95,80)
.thatsStrokeSized(4),
circle
.thatsFilledWith(red)
.thatsStrokeColored(yellow)
.thatsTranslated(90,-25)
.thatsStrokeSized(4),
circle
.thatsFilledWith(red)
.thatsStrokeColored(yellow)
.thatsTranslated(-05,-125)
.thatsStrokeSized(4),
circle
.thatsFilledWith(red)
.thatsStrokeColored(yellow)
.thatsTranslated(-125,-56)
.thatsStrokeSized(4)
)
redPetals.draw
/////////////////////////
////// Center of Flower
def yellowCenter = picStack(
Picture{},
circle
.thatsFilledWith(yellow)
.thatsStrokeColored(yellow)
.thatsTranslated(-20,00)
.thatsStrokeSized(4)
)
yellowCenter.draw
////////////////////////
////// left eyes
def leftEye = picStack(
Picture{},
circle
.thatsStrokeColored(black)
.thatsTranslated(25,60)
.thatsStrokeSized(4)
.thatsScaled(0.25, 0.25),
circle
.thatsFilledWith(black)
.thatsStrokeColored(black)
.thatsTranslated(60,100)
.thatsStrokeSized(3)
.thatsScaled(0.1, 0.1)
)
leftEye.draw
////////////////////////
/////// Right eye
def rightEye = picStack(
circle
.thatsStrokeColored(black)
.thatsTranslated(-180,60)
.thatsStrokeSized(4)
.thatsScaled(0.25, 0.25),
circle
.thatsFilledWith(black)
.thatsStrokeColored(black)
.thatsTranslated(-420,100)
.thatsStrokeSized(3)
.thatsScaled(0.1, 0.1)
)
rightEye.draw
/////////////////////////////////
///// smile
def smile = picStack (
Picture{},
arc
.thatsStrokeColored(red)
.thatsStrokeSized(5)
.thatsRotated(220)
.thatsScaled(0.55, 0.5)
.thatsTranslated(-20,05),
arc
.thatsStrokeColored(black)
.thatsStrokeSized(15)
.thatsRotated(150)
.thatsScaled(0.1, 0.1)
.thatsTranslated(33,-24),
arc
.thatsStrokeColored(black)
.thatsStrokeSized(15)
.thatsRotated(-80)
.thatsScaled(0.1, 0.1)
.thatsTranslated(-72,-24)
)
smile.draw
///////////////////////////