wundr

Snake

there was always a way round.

classic grid snake -- swipe to turn, eat to grow, and a circuit icon that shows you the route that never has to die

A Hamiltonian cycle is a loop that visits every cell of a grid exactly once and returns to where it started. On a grid where at least one side is even, one always exists -- which means a snake that only ever follows that loop can eat, grow, and fill the whole board without ever running into its own body, because by the time its head needs a cell, its tail has already left it. There was always a way round; a perfect player just has to know the route.

Concepts: hamiltonian-cycle, graphs, planning.

An interactive you play with one thumb, on Wundr.