Code Sketch


26 jan Mulvery
By: Mulvery Convent School
Category: Art
cleari
 setSpeed(fast)
 def blr = cm.linearMultipleGradient(40, -100, 40, 200, 
Seq(.1, .5, 1),
Seq(ColorMaker.hsl(94, 50, .20),
white, cm.orange),  
false) //> def blr: java.awt.LinearGradientPaint
setBackground(blr)
//showAxes()
setPosition(-370, -200)
setFillColor(black)
setPenColor(black)
right()
repeat(3) {
forward(720)
right()
forward(30)
right
}
hop(50)
right()
hop(40)
def branch(n: Double) {
    forward(n)
} //> def branch(n: Double): Unit

def tree(n: Double) {
    savePosHe()
    setPenColor(black)
    if (n <= 4) {
        setPenThickness(0.4)
        branch(n / 2)
    }
    else {
        setPenThickness(n / 10)
        branch(n)
        right(25)
        tree(0.8 * n - 2)
        left(25)
        left(20)
        tree(n - 5)
    }
    restorePosHe()
} //> def tree(n: Double): Unit
hop(-40)
tree(50)
right(180)
setPosition(-200,240)
setPenColor(black)
setPenThickness(2)
repeat(18) {
dot(4)
hop(4.3)
}
setFillColor(white)
right(77)
left(360,6)
left(80)
hop(13)
setPenThickness(6)
forward(10)
right(63)
setPenThickness(3)
forward(35)
left(75,35)
right(12)
forward(10)
left(23)
forward(50)
left(64)
forward(52)
jumpTo(-200, 150)
right()
hop(10)
left(63)
setPenThickness(3)
forward(35)
right(75,35)
left(12)
forward(10)
right(23)
forward(50)
left(55)
setFillColor(black)
forward(10)
right(120)
forward(65)
right(123)
forward(9)
jumpTo(-200, 150)
right(160)
hop(10)
right(32)
 def detail {
    setPenThickness(3)
setFillColor(white)
forward(35)
left(75,35)
 }
 detail
right(12)
forward(10)
left(13)
forward(42)
jumpTo(-200, 150)
right(23)
hop(10)
right(39)
detail
right(10)
forward(10)
right(8)
forward(42)
jumpTo(-200, 150)
right(23)
hop(15)
right(19)
detail
right(12)
forward(10)
right(23)
forward(30)
jumpTo(-200, 150)
hop(10)
right(20)
detail
right(22)
forward(10)
right(73)
forward(10)
jumpTo(-250, 60)
left(105)
hop(9)
setPenThickness(4)
forward(90)
setPenThickness(2)
forward(5)
left(63)
forward(25)
left(35)
forward(20)
left(83)
forward(12)
hop(95)
right(180)
setPenThickness(4)
forward(90)
hop(320)
left()
hop(70)
right()
left(95)
setFillColor(white)
left(120)
forward(20)
right(120)
forward(10)
right(90)
forward(17)
right(180)
forward(17)
right(50)
left(90,50)
left(30,100)
right(11,80)
right(130)
left(40,120)
right(40)
repeatFor(rangeTo(1,3)){counter=>
repeat(1){
right(30,50+10*counter)
right(170,3)
left(10,50)
right(180)
}
}
right(35,60)
right(150,2)
left(50,80)
right(50,80)
right(17)
left(14,100)
right(11,80)
right(130)
left(50,120)
right(30,180)
left(150,3)
left(50,40)
repeatFor(rangeTo(1,4)){counter=>
repeat(1){
right(180)
right(5,40)
left(150,6)
left(30+5*counter,50)
}
}
right(20,40)
right(140,1)
right(40,80)
left(170,3)
left(20,50)
repeatFor(rangeTo(1,4)){counter=>
    repeat(1){
right(180)
right(16,50)
left(70)
left(120,8)
left(30,20)
    }
}
right(180)
right(30,20)
left(70)
left(110,8)
right(80,40)
left(100,70)
right(24,129)
left(40)
forward(10)
left(100)
hop(20)
dot(8)
hop(110)
right(45)
right(20,40)
left(30,90)
left(25)
hop(50)
right(240)
repeat(3){
left(20,30)
right(50)
hop(25)
left(50)
}
jumpTo(-270, -40)
left(82)
  setPenFont(Font("Cambria", 16))
  write("On this day, let the cages break,")
hop(-20)
write("Let freedom's symphony resound, awake,")
hop(-20)
write("For in unity's stride, our Republic stands tall,")
hop(-20)
write("A soaring testament to freedom for all.")
hop(-20)

  setPenFont(Font("Cambria", 26))
  write("Happy Republic day")
  // WISHING YOU AND YOUR FAMILY A VERY HAPPY REPUBLIC DAY