Minesweeper Implementations – Review
Catalogues bugs found in nine AI-generated Minesweeper implementations, each with a short description of the defect.
What this file does
Catalogues bugs found in nine AI-generated Minesweeper implementations, each with a short description of the defect.
When to use it
- Reviewing code quality of AI-generated games
- Checking common pitfalls in recursive flood fill or mine placement
- Comparing multiple AI model outputs for a single task
Minesweeper Implementations – Review
Claude (claude/index.html)
- Flood fill uses unbounded recursion; large empty areas can overflow the call stack and freeze the page.
- Flags are unlimited; the mines-left counter can go negative and does not reflect actual mine count, which misleads players.
Codex (codex/index.html)
- Empty-cell expansion is broken: the flood routine never propagates because the neighbor queue is ignored, so only the clicked region opens.
- First-click safety can silently reduce the requested mine count when space is tight, altering custom settings without feedback.
DeepSeek (deepseek/index.html)
- Difficulty clicks call
changeDifficultywithout passing the event, yet the handler usesevent.target; in strict mode this can fail or ignore selection. - Mine placement loop lacks a cap; requesting too many mines can spin indefinitely.
DevStral (devstral/index.html)
- Difficulty changes do not stick:
setDifficultysets rows/cols/mines theninitGameresets to 10×10×10. - Right-click is blocked until after the first left-click, preventing pre-flagging suspected mines.
Gemini (gemini/index.html)
- Right-clicks don’t suppress the browser context menu, making flagging unreliable on desktop.
- Flood fill is fully recursive; large openings risk stack overflows and hangs.
GPT-OSS (gpt-oss/index.html)
- No first-click protection; the opening move can detonate a mine.
- Recursive flood fill can overflow the call stack on large empty regions.
Kimi-K2 (kimi-k2/index.html)
- Win check requires every mine to be flagged; clearing all safe cells without flagging all mines never wins (nonstandard behavior).
- Flags are unrestricted, so over-flagging can prevent win detection; first-click safety only avoids the clicked cell, not its neighbors.
Llama (llama/index.html)
- Neighbor counts use linear indexing without column bounds, causing wrapped counts/reveals across rows (logic incorrect).
- “Hard” advertises 30×16 but code uses a 30×30 grid; no first-click protection.
Qwen (qwen/index.html)
- Mines are placed during init rather than after the first click; the opening move can hit a mine despite the comment.
- Timer interval is never cleared on win/loss, so it keeps running.
- Flags are unbounded; “mines left” can go negative.
What's inside
9 implementation entries, each with 2-3 bullet-pointed bug descriptions
Change this for your project
- Replace
claude/index.htmlwith your own file paths if reviewing different implementations - Replace
senko/vibesweeper-2025with your repository name if publishing the review
Where it goes
Load as policy context for the agent, or keep beside the code enforcing the rules.
Related Documents
DeepSeek R1: Case Study in Failed Extrinsic Alignment
Compiles public security research and independent findings to argue that extrinsic alignment methods are insufficient for AI safety, using DeepSeek R1 as a case study.
Guardrails, Safety & Content Filtering
Implements a layered guardrail system with input validation, output validation, and content filtering to protect LLM applications from prompt injection, jailbreaks, and data leaks.
My Hyprland Rice Setup - Context for Claude Code
Documents a Hyprland rice setup with system specs, aesthetic preferences, workflow safety practices, and a list of current issues to solve.
AI Safety & Guardrails for Voice Assistants
Defines a multi-layer safety architecture for voice assistants, covering input filtering, deterministic FAQ routing, RAG-grounded AI responses, and output guardrails.