Code Sketch


26 jan mulvery
By: Mulvery Convent School
Category: Art
cleari()
clearOutput()
val name = readln("What's your name") //> val name: String = xyz //> val name: String = xyz
val ans = s"Hello $name,you know that Republic Day is special day in our country when we celebrate the adoption of our consititution.It happened on January 26,1950.This day reminds us of the values like equality and freedom that our constitution stands for.We honorthe people who worked hard to give us this constitution." //> val ans: String = Hello xyz,you know that Republic Day is special day in our country when we celebrate the adoption of our consititution.It happened on January 26,1950.This day reminds us of the values like equality and freedom that our constitution stands for.We honorthe people who worked hard to give us this constitution. //> val ans: String = Hello xyz,you know that Republic Day is special day in our country when we celebrate the adoption of our consititution.It happened on January 26,1950.This day reminds us of the values like equality and freedom that our constitution stands for.We honorthe people who worked hard to give us this constitution.
println(ans)
setBackground(black)
setSpeed(slow)
setPenColor(Color(255, 102, 0))
setPosition(-250, 100)
setPenFontSize(200)
write("HAPPY")
forward(100)
cleari()
setBackground(black)
setSpeed(slow)
setPenColor(white)
setPosition(-470, 100)
setPenFontSize(180)
write("REPUBLIC")
forward(100)
cleari()
setBackground(black)
setSpeed(slow)
setPenColor(Color(0, 102, 51))
setPosition(-250, 100)
setPenFontSize(200)
write("DAY")
forward(100)
cleari()
setSpeed(superFast)
setPenColor(black)
setBackground(black)
setPosition(-350, -230)
setFillColor(Color(255, 102, 0))
setPenThickness(7)
setPenColor(white)
forward(450)
setPenThickness(3)
setPenColor(black)
right(57)
right(60,300)
left(60,300)
right(120)
forward(450)
right(61)
right(60,300)
left(64,305.5)
right(126)
setFillColor(white)
forward(300)
right(57)
right(60,300)
left(60,308)
right(120)
forward(299)
right(61.1)
right(60,300)
left(64,305.5)
right(126)
setFillColor(color(0, 102, 51))
forward(150)
right(57)
right(60,308)
left(60,308)
right(120)
forward(150)
right(61.1)
right(60,300)
left(64,305.5)
right(180)
hop(332)
left(90)
setPenColor(Color(0, 0, 128))
setFillColor(white)
setPenThickness(4)
repeat(24){
right(360/24,65)
right(90)
forward(65)
right(180)
forward(65)
right(90)
}
setSpeed(slow)
right(360/24,65)
cleari()
setSpeed(superFast)
setBackground(black)
setPenColor(black)
setPosition(-350, -230)
setFillColor(Color(255, 102, 0))
setPenThickness(7)
setPenColor(white)
forward(450)
setPenThickness(3)
setPenColor(black)
right(180-57)
left(60,300)
right(60,300)
right(180-125)
forward(450)
right(180-56.2)
left(60,305)
right(65,289)
right(180-127)
setFillColor(white)
forward(300)
right(180-57)
left(60,300)
right(60,305)
right(180-125)
forward(303)
right(180-56.2)
left(60,305)
right(65,289)
right(180-127)
setFillColor(Color(0, 102, 51))
forward(150)
right(180-57)
left(60,300)
right(60,310)
right(180-125)
forward(152)
right(180-56.2)
left(60,305)
right(65,289)
right(180-73)
hop(270)
left(90)
setPenColor(Color(0, 0, 128))
setFillColor(white)
setPenThickness(4)
repeat(24){
right(360/24,65)
right(90)
forward(65)
right(180)
forward(65)
right(90)
}
setSpeed(slow)
right(360/24,65)
cleari()
setSpeed(superFast)
setPenColor(black)
setBackground(black)
setPosition(-350, -230)
setFillColor(Color(255, 102, 0))
setPenThickness(7)
setPenColor(white)
forward(450)
setPenThickness(3)
setPenColor(black)
right(57)
right(60,300)
left(60,300)
right(120)
forward(450)
right(61)
right(60,300)
left(64,305.5)
right(126)
setFillColor(white)
forward(300)
right(57)
right(60,300)
left(60,308)
right(120)
forward(299)
right(61.1)
right(60,300)
left(64,305.5)
right(126)
setFillColor(color(0, 102, 51))
forward(150)
right(57)
right(60,308)
left(60,308)
right(120)
forward(150)
right(61.1)
right(60,300)
left(64,305.5)
right(180)
hop(332)
left(90)
setPenColor(Color(0, 0, 128))
setFillColor(white)
setPenThickness(4)
repeat(24){
right(360/24,65)
right(90)
forward(65)
right(180)
forward(65)
right(90)
}
setSpeed(slow)
right(360/24,65)
cleari()
setSpeed(superFast)
setPenColor(black)
setBackground(black)
setPosition(-350, -230)
setFillColor(Color(255, 102, 0))
setPenThickness(7)
setPenColor(white)
forward(450)
setPenThickness(3)
setPenColor(black)
right(180-57)
left(60,300)
right(60,300)
right(180-125)
forward(450)
right(180-56.2)
left(60,305)
right(65,289)
right(180-127)
setFillColor(white)
forward(300)
right(180-57)
left(60,300)
right(60,305)
right(180-125)
forward(303)
right(180-56.2)
left(60,305)
right(65,289)
right(180-127)
setFillColor(Color(0, 102, 51))
forward(150)
right(180-57)
left(60,300)
right(60,310)
right(180-125)
forward(152)
right(180-56.2)
left(60,305)
right(65,289)
right(180-73)
hop(270)
left(90)
setPenColor(Color(0, 0, 128))
setFillColor(white)
setPenThickness(4)
repeat(24){
right(360/24,65)
right(90)
forward(65)
right(180)
forward(65)
right(90)
}
setSpeed(slow)
right(360/24,65)
cleari()
def pic = Picture{
    setSpeed(fast)
setFillColor(white)
right(120)
forward(20)
left(120)
forward(10)
left(90)
forward(17)
right(180)
forward(17)
left(50)
right(90,50)
right(30,100)
left(11,80)
left(130)
right(40,120)
left(40)
repeatFor(rangeTo(1,3)){counter=>
repeat(1){
left(30,50+10*counter)
left(170,3)
right(10,50)
left(180)
}
}
left(35,60)
left(150,2)
right(50,80)
left(50,80)
left(17)
right(14,100)
left(11,80)
left(130)
right(50,120)
left(30,180)
right(150,3)
right(50,40)
repeatFor(rangeTo(1,4)){counter=>
repeat(1){
left(180)
left(5,40)
right(150,6)
right(30+5*counter,50)
}
}
left(20,40)
left(140,1)
left(40,80)
right(170,3)
right(20,50)
repeatFor(rangeTo(1,4)){counter=>
    repeat(1){
left(180)
left(16,50)
right(70)
right(120,8)
right(30,20)
    }
}
left(180)
left(30,20)
right(70)
right(110,8)
left(80,40)
right(100,70)
left(24,129)
right(40)
forward(10)
right(100)
hop(20)
dot(8)
hop(110)
left(45)
left(20,40)
right(30,90)
right(25)
hop(50)
left(240)
repeat(3){
right(20,30)
left(50)
hop(25)
right(50)
}
} //> def pic: net.kogics.kojo.picture.Pic0
setBackground(black)
val sq = picStack(
    pic.withFillColor(Color(255, 102, 0)).withPenColor(black).thatsTranslated(0,0),
    pic.withPenColor(black).thatsTranslated(100,-80),
    pic.withFillColor(Color(0, 102, 51)).withPenColor(black).thatsTranslated(230,-160),
    ) //> val sq: net.kogics.kojo.picture.GPics = Picture Stack (Id: 1567835934)
draw(sq)
setSpeed(slow)
forward(100)
cleari()
def pic1 = Picture{
    setSpeed(fast)
setFillColor(white)
right(120)
forward(20)
left(120)
forward(10)
left(90)
forward(17)
right(180)
forward(17)
left(50)
right(90,50)
right(30,100)
left(11,80)
left(130)
right(40,120)
left(40)
repeatFor(rangeTo(1,3)){counter=>
repeat(1){
left(30,50+10*counter)
left(170,3)
right(10,50)
left(180)
}
}
left(35,60)
left(150,2)
right(50,80)
left(50,80)
left(17)
right(14,100)
left(11,80)
left(130)
right(50,120)
left(30,180)
right(150,3)
right(50,40)
repeatFor(rangeTo(1,4)){counter=>
repeat(1){
left(180)
left(5,40)
right(150,6)
right(30+5*counter,50)
}
}
left(20,40)
left(140,1)
left(40,80)
right(170,3)
right(20,50)
repeatFor(rangeTo(1,4)){counter=>
    repeat(1){
left(180)
left(16,50)
right(70)
right(120,8)
right(30,20)
    }
}
left(180)
left(30,20)
right(70)
right(110,8)
left(80,40)
right(100,70)
left(24,129)
right(40)
forward(10)
right(100)
hop(20)
dot(8)
hop(110)
left(45)
left(20,40)
right(30,90)
right(25)
hop(50)
left(240)
repeat(3){
right(20,30)
left(50)
hop(25)
right(50)
}
} //> def pic1: net.kogics.kojo.picture.Pic0
setBackground(black)
val sq1 = picStack(
    pic1.withFillColor(Color(255, 102, 0)).withPenColor(black).thatsTranslated(-450,180),
    pic1.withPenColor(black).thatsTranslated(-350,100),
    pic1.withFillColor(Color(0, 102, 51)).withPenColor(black).thatsTranslated(-250,20),
    ) //> val sq1: net.kogics.kojo.picture.GPics = Picture Stack (Id: 27875015)
draw(sq1)
setSpeed(slow)
setPenColor(black)
forward(100)
cleari()
def pic5 = Picture{
setSpeed(fast)
left(127)
hop(250)
right(127)
setPenColor(black)
setBackground(black)
setFillColor(Color(255, 102, 0))
repeat(2){
forward(300)
right(90)
forward(400)
right(90)
}
setFillColor(white)
repeat(2){
forward(200)
right(90)
forward(400)
right(90)
}
setFillColor(Color(0, 102, 51))
repeat(2){
forward(100)
right(90)
forward(400)
right(90)
}
setFillColor(white)
right(63)
hop(224)
right(30)
setPenColor(Color(0, 0, 128))
setPenThickness(4)
repeat(24){
left(360/24,49)
left(90)
forward(49)
right(180)
forward(49)
left(90)
}
left(48-0.3)
hop(280)
left(45)
setSpeed(fast)
setPenColor(black)
setPenThickness(2)
right(120)
forward(20)
left(120)
forward(10)
left(90)
forward(17)
right(180)
forward(17)
left(50)
right(90,50)
right(30,100)
left(11,80)
left(130)
right(40,120)
left(40)
repeatFor(rangeTo(1,3)){counter=>
repeat(1){
left(30,50+10*counter)
left(170,3)
right(10,50)
left(180)
}
}
left(35,60)
left(150,2)
right(50,80)
left(50,80)
left(17)
right(14,100)
left(11,80)
left(130)
right(50,120)
left(30,180)
right(150,3)
right(50,40)
repeatFor(rangeTo(1,4)){counter=>
repeat(1){
left(180)
left(5,40)
right(150,6)
right(30+5*counter,50)
}
}
left(20,40)
left(140,1)
left(40,80)
right(170,3)
right(20,50)
repeatFor(rangeTo(1,4)){counter=>
    repeat(1){
left(180)
left(16,50)
right(70)
right(120,8)
right(30,20)
    }
}
left(180)
left(30,20)
right(70)
right(110,8)
left(80,40)
right(100,70)
left(24,129)
right(40)
forward(10)
right(100)
hop(20)
dot(8)
hop(110)
left(45)
left(20,40)
right(30,90)
right(25)
hop(50)
left(240)
repeat(3){
right(20,30)
left(50)
hop(25)
right(50)
}
right(5)
hop(590)
right(85)
setSpeed(fast)
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)
}
} //> def pic5: net.kogics.kojo.picture.Pic0
val ar = picStack(
    pic5.thatsTranslated(0,-350),
    
) //> val ar: net.kogics.kojo.picture.GPics = Picture Stack (Id: 1311184623)
val ar2 = picStack(
    pic5.thatsTranslated(0,0),
    
) //> val ar2: net.kogics.kojo.picture.GPics = Picture Stack (Id: 22221905)
draw(ar)
setSpeed(slow)
forward(80)
cleari()
draw(ar2)
setSpeed(slow)
forward(100)
setSpeed(fast)
setBackground(black)
val cb = canvasBounds //> val cb: edu.umd.cs.piccolo.util.PBounds = PBounds[x=-466.5,y=-319.0,width=933.0,height=638.0]
val clr = cm.linearMultipleGradient(
cb.y, cb.y,
cb.x + cb.height, cb.y + cb.height,
Seq(0, 0.5, 1),
Seq(Color(0, 102, 51), white, Color(255, 102, 0))
) //> val clr: java.awt.LinearGradientPaint = java.awt.LinearGradientPaint@16bd80b4
setBackground(clr)
val pic6 = Picture{
setFillColor(black)
setPenColor(black)
setSpeed(fast)
left(10)
right(20,100)
left(40,10)
right(90,5)
left(70,2)
right(10,100)
right(80,10)
left(10,80)
left(120,8)
right(80,2)
left(50)
right(70,20)
right(30,30)
right(70,3)
left(50)
right(120,18)
left(110,10)
left(10,150)
right(90,1)
left(90,1)
left(10,30)
left(120)
left(10,120)
left(80,2)
right(5,40)
right(170,1.5)
left(10,20)
left(100,2)
right(25,50)
right(140,1)
right(30,40)
right(70)
left(170,2)
right(85)
right(40,70)
right(90,2)
right(30,30)
left(10)
left(40,40)
left(10)
left(20,20)
left(15)
left(11,180)
left(40,15)
right(131)
forward(50)
right(120)
right(20,20)
left(75)
right(20,80)
left(178)
right(30,60)
right(55)
forward(6)
} //> val pic6: net.kogics.kojo.picture.Pic0 = Picture with Id: 2063881942
val pic7 = picStack(
    pic6.thatsTranslated(-400,-320),
) //> val pic7: net.kogics.kojo.picture.GPics = Picture Stack (Id: 30592254)
draw(pic7)