Snake AI vs Human! Python Hamiltonian Tutorial
Everyone knows Nokia for their indestructible phones, but did you know they were pioneers in mobile gaming? In Finland, 1998, Taneli Armanto and his team created the iconic Snake game, programming its graphics directly in machine code due to tight storage constraints. While today's phones can store games up to 35GB (looking at you, Genshin Impact), the simple Snake game remains a classic. In this video, we dive into how Snake relates to graph theory, specifically focusing on Hamiltonian cycles. Graph theory, the study of vertices and edges, offers practical applications beyond abstract concepts like piecewise-smooth-simple-closed-curves. We explore how Snake can be "solved" using Hamiltonian cycles, ensuring the snake never eats its own tail. I'll show you the depth-first search algorithm with backtracking that I used to create a reactive Snake AI, capable of navigating obstacles and maximizing its path. Join me as we delve into the code behind the Hamiltonian cycle logic, discuss the intricacies of snake movement, and reveal the tricks used to make the AI adaptive and efficient. GitHub: https://github.com/JTexpo/Snake_Hamiltonian_Cycle Website: https://jtexpo.github.io/Snake_Hamiltonian_Cycle/ Timestamps: 00:00 intro 00:14 Taneli Armanto & Snake 00:55 Graph Theory 01:34 Hamiltonian Cycle 01:55 How the Snake AI Works 02:53 The Code - Hamiltonian Cycle 03:44 The Code - Snake 05:00 outro Music: blurred figures x fourwalls - you came back (Kupla Master) Provided by Lofi Girl Watch: https://youtu.be/5Jc6zOxXyjM Listen: https://open.spotify.com/track/5lqRURIS1rrL8KoyZQZWH4 #algorithm #ai #snakegame #python #pythoncoding #codingtutorial #gamedev #artificialintelligence #website #webgame #pythontutorial #codingtutorial #aitutorial
Download
0 formatsNo download links available.