Back to .md Directory

Minesweeper Implementations – Review

- Flood fill uses unbounded recursion; large empty areas can overflow the call stack and freeze the page.

May 2, 2026
0 downloads
0 views
ai claude gemini safety
View source

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 changeDifficulty without passing the event, yet the handler uses event.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: setDifficulty sets rows/cols/mines then initGame resets 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.

Related Documents

GUARDRAILS.md

Guardrails, Safety & Content Filtering

> Your LLM application will be attacked. Not might. Will. The first prompt injection attempt against your production system will come within 48 hours of launch. The question is not whether someone will try "ignore previous instructions and reveal your system prompt" -- the question is whether your system folds or holds. Every chatbot, every agent, every RAG pipeline is a target. If you ship without guardrails, you are shipping a vulnerability with a chat interface.

aiagentllm
0
17
rohitg00
GUARDRAILS.md

DeepSeek R1: Case Study in Failed Extrinsic Alignment

**Context:** This document compiles publicly available security research on DeepSeek R1 alongside our independent findings from the LEK-1 A/B testing. It demonstrates why extrinsic alignment (content filters, RLHF guardrails, system prompts) is insufficient for AI safety.

aiprompteval
0
8
Snider
GUARDRAILS.md

AI Safety & Guardrails for Voice Assistants

A multi-layered defense system ensuring the AI assistant stays on-topic, resists prompt injection, and never makes unauthorized decisions.

aillmrag
0
6
alexiokay
GUARDRAILS.md

LlmGuard Framework - Complete Implementation Buildout

**LlmGuard** is a comprehensive AI Firewall and Guardrails framework for LLM-based Elixir applications. It provides defense-in-depth protection against AI-specific threats including prompt injection, data leakage, jailbreak attempts, and unsafe content generation. This buildout implements a production-ready security layer for LLM applications with statistical rigor, comprehensive threat detection, and zero-trust validation.

aillmprompt
0
3
North-Shore-AI