Gemma 4 Plays Snake: A Real-Time AI Game Loop
Denis Arruda
This is a submission for the Gemma 4 Challenge: Build with Gemma 4 What I Built I built a Snake game where the snake is driven entirely by Gemma 4. The model reads the board, reasons about the move, and the snake follows. The backend is a Quarkus application written in Java 26 with virtual threads. A scheduler fires every 200 ms, advances the snake one cell, checks for collisions and food, and broadcasts the updated board as JSON to every connected browser over WebSocket. The UI is a plain HTML5
