Snake Ai Python Code, The snake learned to circle safely when trapped, wait for openings, and even take detours.