Code Sketch


Happy Birthday (Created by Eniyan : Grade 6)
By: Alkubra Nusaiba Hassan
val cb=canvasBounds

var pic=Picture{
  repeat(19){
  repeat(4){
  setFillColor(randomColor)  
repeat(5){
  forward(10)
  right(360/5)
}
left()
}
forward(30)
}
} 
pic.setPosition(cb.x+15,cb.y)
draw(pic)

 
val pic1=Picture{
  right()
  repeat(23){
  repeat(4){
    setFillColor(randomColor)
repeat(5){
  forward(10)
  right(360/5)
}
left()
}
forward(30)
}
}
pic1.setPosition(cb.x, cb.y+15)
draw(pic1)

 
val pic2=Picture{
  repeat(19){
  repeat(4){
    setFillColor(randomColor)
repeat(5){
  forward(10)
  right(360/5)
}
left()
}
forward(30)
}
}
pic2.setPosition(cb.x+630, cb.y)
draw(pic2)


val pic3=Picture{
  right()
  repeat(23){
  repeat(4){
    setFillColor(randomColor)
repeat(5){
  forward(10)
  right(360/5)
}
left()
}
forward(30)
}
}
pic3.setPosition(cb.x, cb.y+530)
draw(pic3)


val H=Picture{
  setPenColor(randomColor)
  setPenThickness(10)
forward(32)
left()
hop(20)
left()
forward(32)
right(180)
forward(15)
right()
forward(20)
}
draw(H)
H.setPosition(cb.x+75, cb.y+400)


val A1=Picture{
  setPenColor(randomColor)
  setPenThickness(7)
right(30)
forward(32)
right(120)
forward(32)
left(180)
forward(6)
left(30)
forward(18)
}
draw(A1)
A1.setPosition(cb.x+90, cb.y+400)


val P1=Picture{
  setPenThickness(10)
setPenColor(randomColor)
forward(32)
right()
right(180,10)
}
draw(P1)
P1.setPosition(cb.x+135, cb.y+400)


val P2=Picture{
  setPenColor(randomColor)
  setPenThickness(10)
forward(32)
right()
right(180,10)
}
draw(P2)
P2.setPosition(cb.x+160, cb.y+400)


val Y=Picture{
  setPenColor(randomColor)
  setPenThickness(10)
  right(20)
forward(38)
right(180)
forward(20)
right(120)
forward(20)
}
draw(Y)
Y.setPosition(cb.x+188, cb.y+400)


val B=Picture{
  setPenColor(randomColor)
  setPenThickness(8)
forward(32)
right()
right(180,7)
right(180)
right(180,7)
}
draw(B)
B.setPosition(cb.x+155, cb.y+300)


val I=Picture{
  setPenColor(randomColor)
  setPenThickness(10)
forward(34)
}
draw(I)
I.setPosition(cb.x+175, cb.y+300)


val R=Picture{
  setPenColor(randomColor)
  setPenThickness(7)
forward(32)
right()
right(180,8)
left(135)
forward(20)
}
draw(R)
R.setPosition(cb.x+195, cb.y+300)


val T=Picture{
  setPenColor(randomColor)
  setPenThickness(8)
forward(32)
right()
forward(10)
right(180)
forward(20)
}
draw(T)
T.setPosition(cb.x+220, cb.y+300)


val H2=Picture{
  setPenColor(randomColor)
  setPenThickness(10)
forward(34)
left()
hop(20)
left()
forward(34)
right(180)
forward(16)
right()
forward(20)
}
draw(H2)
H2.setPosition(cb.x+265, cb.y+300)


val D=Picture{
  setPenColor(randomColor)
  setPenThickness(8)
forward(32)
right()
right(180,15)
}
draw(D)
D.setPosition(cb.x+325, cb.y+300)


val A2=Picture{
  setPenColor(randomColor)
  setPenThickness(7)
right(30)
forward(32)
right(120)
forward(32)
left(180)
forward(7)
left(30)
forward(17)
}
draw(A2)
A2.setPosition(cb.x+350, cb.y+300)


val Y2=Picture{
  setPenColor(randomColor)
  setPenThickness(10)
  right(20)
forward(38)
right(180)
forward(20)
right(120)
forward(20)
}
draw(Y2)
Y2.setPosition(cb.x+395, cb.y+300)


val T2=Picture{
  setPenColor(randomColor)
  setPenThickness(8)
forward(32)
right()
forward(10)
right(180)
forward(20)
}
draw(T2)
T2.setPosition(cb.x+220, cb.y+200)


val O=Picture{
  setPenColor(randomColor)
  setPenThickness(8)
right(360,14)
}
draw(O)
O.setPosition(cb.x+245, cb.y+215)


val Y3=Picture{
  setPenColor(randomColor)
  setPenThickness(10)
  right(20)
forward(38)
right(180)
forward(20)
right(120)
forward(20)
}
draw(Y3)
Y3.setPosition(cb.x+355, cb.y+200)


val O2=Picture{
  setPenColor(randomColor)
  setPenThickness(8)
right(360,14)
}
draw(O2)
O2.setPosition(cb.x+380, cb.y+215)


val U=Picture{
  setPenColor(randomColor)
  setPenThickness(8)
  hop(32)
  right(160)
right(220,18)
}
draw(U)
U.setPosition(cb.x+455, cb.y+195)


val dot1=Picture{
  setPenColor(randomColor)
  setPenThickness(8)
right(360,5)
}
draw(dot1)
dot1.setPosition(cb.x+475, cb.y+205)


val dot2=Picture{
  setPenColor(randomColor)
  setPenThickness(8)
right(360,5)
}
draw(dot2)
dot2.setPosition(cb.x+495, cb.y+205)


val dot3=Picture{
  setPenColor(randomColor)
  setPenThickness(8)
right(360,5)
}
draw(dot3)
dot3.setPosition(cb.x+515, cb.y+205)
def square(n:Int , c:Color) {
setFillColor(c)
repeat(4){
forward(n)
right()
}
}