Implementing a Triangle Grid
Learn to implement a triangle grid in Ruby.
We'll cover the following...
Introduction to triangle grids
A grid of triangles has a very lattice-like look:
As with the hexagons, there are going to be lots of ways to implement a grid like this, and each will have different strengths and weaknesses. For simplicity’s sake, we’ll look at one that most closely approximates the regular grid, with horizontal rows and vertical columns. We’ll use equilateral triangles (mostly because it makes the math easier), and we’ll start with an examination of the cells and how they fit together. We’ll see that ...