3.5.5 Hexagon Codehs -
hex.beginPath(); for(var i = 0; i < 6; i++) hex.forward(50); hex.left(60);
❌ ✅ Adjust goTo(x, y) to center it. Try (150, 200) . Want a Filled Hexagon? If the exercise allows filling: 3.5.5 hexagon codehs
❌ ✅ Make sure i < 6 (six sides).
function drawHexagon(t, sideLength) for(var i = 0; i < 6; i++) t.forward(sideLength); t.left(60); // Exterior angle If the exercise allows filling: ❌ ✅ Make
Now go submit that perfect hexagon and watch those green checkmarks roll in! ✅ Modify your function to draw a hexagon of any size from any starting point. Then try drawing a honeycomb pattern! 🐝 Then try drawing a honeycomb pattern
After 6 iterations, the turtle has turned 6 × 60° = 360° , returning to its original heading. The shape closes perfectly. ❌ Using right(120) or left(120) ✅ Use left(60) – the exterior angle.
