TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: Competition to write the most efficient bot to be King Of The Grid

4 点作者 desertkun3 个月前
Out of boredom I&#x27;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:&#x2F;&#x2F;github.com&#x2F;kingofthegrid&#x2F;king-of-the-grid">https:&#x2F;&#x2F;github.com&#x2F;kingofthegrid&#x2F;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&#x27;s a draw.<p>It includes includes an online in-browser IDE: <a href="https:&#x2F;&#x2F;kingofthegrid.com&#x2F;ide&#x2F;" rel="nofollow">https:&#x2F;&#x2F;kingofthegrid.com&#x2F;ide&#x2F;</a> that way you don&#x27;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.

暂无评论

暂无评论