Implementing the Sidewinder Algorithm

Learn to implement the Sidewinder algorithm in Ruby.

Implementing the Sidewinder algorithm on Grid

The Sidewinder algorithm is similar in many respects to the Binary Tree algorithm. You'll recall that it has similar biases, and even a (conceptually) similar approach, randomly choosing at each step to either carve east from the current cell or north from the current run of cells. In practice, though, Sidewinder feels very different.

Let's implement the code.

The Sidewinder class

Get hands-on with 1200+ tech skills courses.