The Honeycomb Challenge

honeycomb-pattern-300Honeycomb is a structure of hexagonal cavities (cells of wax), made by bees to store honey and eggs.

In this challenge we will use a set of iterative algorithms to draw a honeycomb pattern.

First, we will create a function to draw a single hexagonal cavity. Our function called drawCavity() will take three parameters:

  • x – the x coordinates to position the hexagon.
  • y – the x coordinates to position the hexagon.
  • edgeLength – the length in pixels of an edge of the hexagon.

honeycomb-cavity

We will then need to use some nested for loops in order to tessellate the hexagonal cell to recreate a 2D honeycomb pattern.
honeycomb

Python Code


We have started the code for you, using Python Turtle. You will need to complete this code further to complete the pattern fully.

unlock-access

Solution...

The solution for this challenge is available to full members!
Find out how to become a member:
➤ Members' Area

Did you like this challenge?

Click on a star to rate it!

Average rating 3.5 / 5. Vote count: 11

No votes so far! Be the first to rate this post.

As you found this challenge interesting...

Follow us on social media!

Tagged with: , ,