Code Sketch
Polygon
Category: Math
clear()
showAxes()
setSpeed(superFast)
setPenColor(red)
setPenThickness(5)
setFillColor(Color(0, 65, 196))
setBackgroundH(Color(71, 249, 200, 220), Color(255, 198, 241))
//To draw a 5-sided polygon with repeat command
right()
hop(-300)
repeat(5) {
forward(50)
left(72)
}
//To draw a 6-sided polygon with repeat command
hop(150)
repeat(6) {
forward(50)
left(60)
}
//To draw a 7-sided polygon with repeat command
hop(150)
repeat(7) {
forward(50)
left(51.42)
}
//To draw a 8-sided polygon with repeat command
hop(150)
repeat(8) {
forward(50)
left(45)
}