The idea
A genetic algorithm treats each attempt to escape as an individual in a population. Each one has a “genome” — a sequence of moves. The ones that get closer to the exit are scored higher, the best are combined and mutated, and over many generations the population converges on a route that works. Nobody tells it the answer; it finds it.What makes it fun
- You can watch it learn. Early generations flail around uselessly. Later ones move with something that looks unnervingly like intent.
- The fitness function is everything. How you reward “progress” completely changes what the algorithm discovers — including the clever, cheating solutions you didn’t intend.
- It’s all in the browser. Built with JavaScript, CSS and HTML, so it runs anywhere with no setup.
Source on GitHub
miltonials/scape-room