Code Sketch


Lord Ganesha's Image
By: Saanvi Mahesh Madgaonkar
Category: Art
clear()
setSpeed(medium)
setPosition(-100,50)
setPenColor(Color(255, 102, 0))
setPenThickness(10)
penUp

def backgroundColor = cm.radialMultipleGradient(
    0, 0, 
    500, 
    Seq(0,0.4,0.7), 
    Seq(Color(255, 255, 228), Color(255, 255, 102), Color(208, 151, 43)), 
    false)
setBackground(backgroundColor)

def curve(){
    repeat(180){
        right(1)
        forward (1)
    
    }
}



penDown
curve()
left(90)

setHeading(90)
curve()
forward(100)
lineTo(100,-100)

setPosition(-100,50)
setHeading(270)
forward(100)
lineTo(-70,-100)

setHeading(90)
setPosition(-70,-100)
lineTo(-30,-100)
setPosition(100,-100)
lineTo(50,-100) 

setPosition(-20,30)
setHeading(90) 
forward(-100)
lineTo(-30,-100) 
lineTo(-5,-150) 



setPosition(40,30)
setHeading(90) 
forward(-100)
lineTo(50,-100) 
lineTo(30,-150)
setHeading(90)
left(90)
forward (40)
setHeading(90)

setPosition(-215,50)
left(0)
curve()
forward(100)
left(0)
curve()
setPosition(-215,50)
left(270)
curve()




setPosition(130,50)
left(270)
curve()
setPosition(130,50)
forward(100)
setPosition(245, -50)
right(0)
curve()
setPosition(245, -65)
right(270)
curve()

setPosition(-20,25)
eye()

def eye() {
setPenFontSize(30)
setPenColor(black)
write("O")

setPenFontSize(29)
setPenColor(black)
write("O")

setPenFontSize(27)
setPenColor(black)
write("O")

setPenFontSize(25)
setPenColor(black)
write("O")
}


setPosition(78,25)
eye()



setPosition(0,10)
setPenThickness(5)
forward(20)

repeat(4) {
right(90)
hop(20)
right(90)
forward(20)
left(90)
hop(20)
left(90)
forward(20)
}


setPosition(-300,-180)
setHeading(90)
write("Saanvi Mahesh Madgaonkar, VII, St. Joseph's Institute, Vasco")