A Double DQN agent that plays Snake, written entirely in KingCobra A developer built a Double DQN agent that learns to play Snake entirely in KingCobra, their own programming language, using only its standard library with no Python or external dependencies. The agent, a 19→96→96→3 network with 11,523 parameters, reaches a mean score of 33.1 (best 50) over 100 greedy games on a 10×10 board after roughly two minutes of training on one CPU core. Removing the flood-fill free-space inputs drops the mean score from 33 to 21, and the project ships with a live web dashboard served by KingCobra's std.http. I built a Double DQN agent that learns to play Snake , and every part of it is written in KingCobra https://github.com/DivyanshuSinha136/KingCobra , my programming language: the game, the replay buffer, the neural-network training, the HTTP server and a live web dashboard. It uses only KingCobra's standard library std.nn , std.http , std.json and std.system . There is no Python and there are no external dependencies. Repo: https://github.com/DivyanshuSinha136/KingCobra-Snake-DQN https://github.com/DivyanshuSinha136/KingCobra-Snake-DQN The dashboard, captured from the real app: the trained agent playing, what it sees and wants, and how it learned. | Score | mean 33.1 best game 50 over 100 greedy games on a 10×10 board | | Training | about 2 minutes on one CPU core | | Agent | Double DQN, 3-step returns, Huber loss, gradient clipping, soft target updates, optional prioritized replay | | Network | 19 → 96 → 96 → 3, 11,523 parameters | | Reproducible | one seed controls everything, and two runs with the same seed give bit-identical models | The model is small on purpose. The interesting part is that a training loop of this kind runs end to end in a language I wrote, on its own interpreter. You need KingCobra 1.0 kingcobra on your PATH , and node only for the front-end tests. git clone https://github.com/DivyanshuSinha136/KingCobra-Snake-DQN cd KingCobra-Snake-DQN make serve open http://127.0.0.1:8765, a pre-trained model is included make watch or watch it play in the terminal make train retrain from scratch about 2 minutes on one CPU core make test 48 KingCobra tests plus front-end tests No make ? Every target is one command: kingcobra run src/main.kc