A neural network learns to play snakes in the terminal
It was built from scratch using Rust and Ratatui
Check out this for an older version of the AI that uses macroquad for GUI

git clone git@github.com:bones-ai/rust-snake-ai-ratatui.git
cd rust-snake-ai-ratatui
cargo run --release
src/configs.rsIS_LOW_DETAIL_MODE for a minimal UI, it runs fasterIS_SAVE_BEST_NET to train your own network. Networks are saved in data/net.json, once saved you can use the trained network by setting IS_LOAD_SAVED_NETdata/net-100.json to watch the AI complete the game for 15x15 board sizeUSE_GAME_CANVAS to true and update VIZ_GAME_SCALE to scale the game if needed.Here are some excellent resources to learn more about genetic algorithms: - Video Series: Genetic Algorithm by The Coding Train. - Book: Nature of Code by Daniel Shiffman for those who prefer reading. - I highly recommend checking out Joshka's fork for more idiomatic Rust code.
Generation 0. This iterative process leads to snakes fine-tuning their strategies, resulting in longer snakes over time.
$ claude mcp add rust-snake-ai-ratatui \
-- python -m otcore.mcp_server <graph>