I trapped AI in Snake game for 24 hours

Can AI learn to play Snake from scratch and beat the entire game? In this video I used neuroevolution — an approach that grows a population of 100 neural networks, which evolve through natural selection. And for the finale, I plugged in a Hamiltonian cycle — a mathematically constructed route that's guaranteed to fill the entire grid. ⏱️ TIMESTAMPS 00:00 — Intro 00:16 — Setup 00:33 — How the AI "sees" the field (24 vision rays) 01:22 — First 10 hours of training 05:09 — 20 hours of training 05:50 — Hamiltonian cycle: how the mathematical guarantee works 06:59 — Final run 09:45 — ENDING: AI fills the entire grid 🛠️ TECH USED • Genetic algorithm with tournament selection and elitism • Feedforward neural network: 24 inputs → 16 neurons (tanh) → 4 outputs • Hamiltonian cycle (boustrophedon) with local shortcuts for the final phase • Custom game simulation in JavaScript ❓ A QUESTION FOR YOU Do you think it would be possible to train an AI to beat the game WITHOUT switching to a Hamiltonian cycle? Drop your ideas in the comments — genuinely curious to hear them. 👍 If you enjoyed it — hit the like button, it actually helps the channel a lot. Subscribe if you want more videos about AI and algorithms. #artificialintelligence #neuralnetworks #neuroevolution #hamiltoniancycle #programming #ai #snakegame #machinelearning #algorithms #coding