Code Sketch


Rakhi by AMOL SAVIL NAIK in kojo
By: Amol naik
clear
setPosition(-30, 100)
setSpeed(medium)
setPenThickness(10)
setPenColor(yellow)
setFillColor(red)
setBackground(color(190, 11, 147))
zoom(0.5)
def curve(){
    repeat(180){
        right(1)
        forward(0.5)
    }
}

curve()
right(-150)
curve()
right(-150)
curve()
right(-150)
curve()
right(-150)
curve()
right(-150)
curve()
right(-150)
curve()
right(-150)
curve()
right(-150)
curve()
right(-150)
curve()
right(-150)
curve()
right(-150)
curve()
right(-150)
right(90)
hop(-40)
right(90)
hop(102)
setPenColor(white)
setFillColor(yellow)
circle(70)
right(-90)
hop(70)
setPenThickness(15)
setPenColor(orange)
setFillColor(red)
right
hop(25)
right(-90)
circle(25)
right(90)

setPenColor(black)
val fillc = cm.linearGradient(0, 0, ColorMaker.hsl(0, 0.97, 0.48), 0, 70, cm.yellow, false)

def halfPetal = Picture {
    left(45)
    right(90, 50)
}

def petal = picStack(halfPetal, halfPetal.withFlippedX)
    .withFillColor(fillc)
    .withPenColor(cm.black)
    .withPenThickness(1)

val nump = 7

def flower(petals: Int): Picture = {
    if (petals == 1)
        petal
    else
        picStack(petal, flower(petals - 1).thatsRotated(360.0 / nump))
}

draw(flower(nump))

hop(85)    
setPenColor(white)
dot(20)
hop(-100)
left(-122)
hop(110)
dot(20)
hop(-100)
left(-122)
hop(110)
dot(20)
hop(-100)
left(-60)
hop(110)
dot(20)
hop(-89)
left(37)
hop(90)
dot(20)
hop(-100)
left(-158)
hop(110)
dot(20)
hop(-100)
left(-143)
hop(115)
dot(20)
hop(-100)
left(-126)
hop(110)
dot(20)
hop(-100)
left(-120)
hop(115)
dot(20)
hop(-100)
left(65)
hop(100)
dot(20)
hop(-100)
left(-125)
hop(110)
dot(20)
hop(-100)
left(-30)
hop(105)
dot(20)
hop(-105)
right(120)
hop(145)
right(16)

setPenThickness(10)
setPenColor(yellow)
curve()
right()
hop(32)
setPenColor(red)
dot(15)
right()
hop(45)
setPenThickness(25)
forward(250)
setPenColor(white)
setPenThickness(15)
setFillColor(white)
circle(1)
hop(-25)
circle(1)
hop(-25)
circle(1)
hop(-25)
circle(1)
hop(-25)
circle(1)
hop(-25)
circle(1)
hop(-25)
circle(1)
hop(-25)
circle(1)
hop(-25)
circle(1)
hop(-25)
circle(1)
hop(-25)
circle(1)
hop(-40)
right()
hop(30)
right(87)
hop(275)
setFillColor(red)
setPenThickness(10)
setPenColor(yellow)
left(0)
curve()
right()
hop(31)
setPenColor(red)
dot(25)
right()
hop(48)
setPenThickness(25)
forward(250)
setPenColor(white)
setPenThickness(15)
setFillColor(white)
circle(1)
hop(-25)
circle(1)
hop(-25)
circle(1)
hop(-25)
circle(1)
hop(-25)
circle(1)
hop(-25)
circle(1)
hop(-25)
circle(1)
hop(-25)
circle(1)
hop(-25)
circle(1)
hop(-25)
circle(1)
hop(-25)
circle(1)
hop(-40)
hop(300)
setFillColor(color(190, 11, 147))
setPenThickness(5)
setPenColor(white)
setHeading(270)
savePosHe()
forward(100)
right(45,50)
circle(10)
restorePosHe()
setHeading(250)
savePosHe()
forward(70)
right(45,50)
circle(10)
restorePosHe()
setHeading(230)
savePosHe()
forward(50)
right(45,50)
circle(10)
restorePosHe()
left(82.5)
hop(880)

setHeading(-470)
savePosHe()
forward(100)
right(45,50)
circle(10)
restorePosHe()
setHeading(-450)
savePosHe()
forward(70)
right(45,50)
circle(10)
restorePosHe()
setHeading(-430)
savePosHe()
forward(50)
right(45,50)
circle(10)
restorePosHe()
right(-170)
hop(600)
left()
hop(200)
setPenFontSize(70)
setPenColor(white)
setHeading(90)
setPenFont(Font("Cambria", 70))
        // write with Cambria font
write("HAPPY RAKSHA BANDHAN")