Out of boredom I've created a competition where the goal is to write the most efficient both to be King Of The Grid.<p>Code: <a href="https://github.com/kingofthegrid/king-of-the-grid">https://github.com/kingofthegrid/king-of-the-grid</a><p>Rules:<p>* World size: 32x32 cells<p>* Two bots (or programs) spawn in top-left and bottom-right corners<p>* Each bot has a set of energy. See rules.cpp for exact values.<p>* Bots run on Z80 CPU. See CPUs section.<p>* Walls (obstacles) are generated before each game starts, such as it is guaranteed there is a path between two bots.<p>* Food (static) and prey (moves) are spawned periodically.<p>* Food and Walls are not spawned evenly: random noise is applied using FastNoiseLite on rules described on seasons.cpp<p>* Both can move around, eat, scan environment and clone themselves. See bot_api.h<p>* Bot that survives the longest, wins.<p>* If both bots survive for too long, it's a draw.<p>It includes includes an online in-browser IDE: <a href="https://kingofthegrid.com/ide/" rel="nofollow">https://kingofthegrid.com/ide/</a> that way you don't even have to download anything to spitball ideas. After compiling, you can test your code in browser as well.<p>Bots can move around, eat prey, and clone themselves, all written in C code with a provided API.
Everything is on github, so after a bot is submitted and merged, the main page leaderboard is automatically re-calculated.