Show HN: A competition game to write bots for the most efficient algo
Published on: 2025-07-14 15:52:26
King Of The Grid
A Z80 Sandbox Competition Game in which developers can write bots to compete on the most efficient algorithm to be King Of The Grid!
king-of-the-grid.mp4 Example of a single competition.
Game Rules
See rules.cpp for exact rules (how often, what values etc).
World size: 32x32 cells
Two bots (or programs) spawn in top-left and bottom-right corners
Each bot has a set of energy. See rules.cpp for exact values.
Bots run on Z80 CPU. See CPUs section.
Walls (obstacles) are generated before each game starts, such as it is guaranteed there is a path between two bots.
Food (static) and prey (moves) are spawned periodically.
Food and Walls are not spawned evenly: random noise is applied using FastNoiseLite on rules described on seasons.cpp
Both can move around, eat, scan environment and clone themselves. See bot_api.h
Bot that survives the longest, wins.
If both bots survive for too long, it's a draw.
Live demo
See kingofthegrid.com.
Online IDE to participate
Wr
... Read full article.