šŸŽ² Southern Food and Graph Theory: Part 3
jordanseiler.xyzĀ·1d
⬛Ditherpunk
Preview
Report Post

In the last part of this series, I walked through examining Cracker Barrel’s version of peg solitaire as a graph, and determined that the graph is easily small enough to process by computer.

In this part, we’re going to look at how to implement the basic parts of the game in Rust. Get your snacks! This is a long one!

Trouble with Triangles

The first problem with implementing the game is deciding how to store the triangular game board in memory.

For games with rectangular boards, like chess or checkers, representing the board is straightforward with a 2-dimensional array or list. But, a triangular board is slightly more involved to store and process.

To make the board easier to reason about, let’s realign it so that it’s drawn as a right triangle instead of an equilateral one…

Similar Posts

Loading similar posts...