◀ VibeCruiser

snake agent

A free snake game — play it in your browser, no install. A survival-first Snake game with a planning and reflection AI agent.

by @fish0226-hub · fish0226-hub/snake-agent on GitHubLANG JavaScript★ 1HOSTED ON FISH0226-HUB.GITHUB.IOUPDATED 19 Oct 2026

Vote and save it — free account with email or sign in with GitHub

Made this, @fish0226-hub? See how many people played it → or use email

Best with a keyboard. Controls: Arrow keys · Space · Mouse

▶ Play full screen ▲ Vote: free account with email ▲ Or sign in with GitHub

GitHub may ask you to sign in, then to let VibeCruiser “Verify your GitHub identity” and “Act on your behalf”. We only read your profile and email, and never post anything.

Open the live demo Source on GitHub

From the README

一个生存优先、会规划路径、能反思上一步的贪吃蛇游戏。

普通贪吃蛇只会朝食物直线前进;这个 Agent 每一步都会先问自己:“我吃得掉这口食物,但我还出得来吗?” 它会用 BFS 评估每个候选方向移动后的可达空间、回到尾部的路径与食物距离,并输出严格的「观察 / 推理 / 最终动作」决策记录。

▶ 在线试玩 · AI 演示模式

🎮 原生 Canvas 贪吃蛇,键盘 / 触屏方向键均可操作。 🤖 一键 AI 接管,实时展示每一步的思考过程。 🧠 生存优先:移动后可达空间不足蛇长,或没有回到尾部的路径,直接排除。 🍎 拒绝无脑贪心:只在安全走法里按 BFS 距离靠近食物。 🚫 三条底线:不掉头、不撞墙、不自噬。 🔁 反思机制:上一步的结果(是否吃到、距离变化)会进入下一步观察。 📱 响应式界面,支持手机、桌面与 prefers-reduced-motion. ✅ 零运行时依赖,8 个 Agent 单元测试。

吃到食物得 10 分;填满整个棋盘即可通关。最高分保存在 localStorage。

淘汰非法动作:越界、掉头、撞到蛇身(尾巴将要让位的格子除外)。 模拟移动:更新蛇身,若吃到食物则增长。 检查逃生空间:从新蛇头做洪泛填充(flood fill),统计可达空格数。 可达空间 ≥ 新蛇长 才视为安全。

Read the full README on GitHub →

Built something like this? Submit your vibe — free account, takes a minute. How listing works.

More like this

More snake games →

Made this?

Claim it: create a free account, then press CLAIM THIS in the cruiser. Put the badge below in your README or on your demo page first; that link is how we know it's yours.

Your project is on the cruise, loaded live from your own site. Put the badge in your README or on the demo page: it shows your live play count, it links back to this page, and everyone who lands here is one click from running the real thing.

On VibeCruiser

How listing, the badge and claiming work →