A unique minesweeper game that lets you explore an AI-generated world of characters. Input any theme that interests you, and watch as AI intelligently generates relevant characters and misleading options. Through gameplay, discover and learn about characters related to your chosen theme.
- 🎮 Classic minesweeper gameplay (10x10 grid, 20 mines)
- 🤖 AI-powered concept generation using Claude via OpenRouter
- 👤 Character-based concept mapping:
- 80 safe cells with character-related concepts
- 20 mines with character-unrelated concepts
- 🎯 Interactive gameplay:
- Left-click to reveal cells
- Right-click to place/remove flags
- Tooltips showing concepts on revealed cells
- Color-coded numbers for adjacent mine counts
- 🌏 Multi-language support (Chinese/English)
- 📱 Responsive design for various screen sizes
2.15.1.mp4
Here are some screenshots of the game interface:
The landing page where you can start a new game
Input your chosen character and select language
Active gameplay showing revealed cells and flags
Game over screen showing all cells
- Frontend: Next.js 14 (App Router)
- Styling: Tailwind CSS + shadcn/ui
- State Management: React hooks (useState + useCallback)
- AI Integration: OpenRouter API with Claude
- Language: TypeScript
Before you begin, ensure you have:
- Node.js 18.17 or later
- pnpm 8.0 or later
- An OpenRouter API key (get one at https://openrouter.ai)
- Clone the repository:
git clone https://github.com/yourusername/YYMinesweeper.git
cd sweeper
- Install dependencies:
pnpm install
- Start the development server:
pnpm dev
- Open http://localhost:3000 in your browser
- Enter your OpenRouter API key when prompted
- Input a character of your choice (e.g., "Sherlock Holmes", "Marie Curie")
- Select your preferred language (中文/English)
- Wait for AI to generate character-related concepts
- Start playing:
- Left-click to reveal cells
- Right-click to place/remove flags
- Numbers show adjacent mines
- Hover over revealed cells to see concepts
- Flag all mines and reveal all safe cells to win
src/
├── app/ # Next.js app router pages
├── components/ # React components
│ ├── ui/ # shadcn/ui components
│ ├── game-board/ # Game board & cell components
│ └── api-key-dialog # API key management
├── lib/ # Utilities and API integration
└── types/ # TypeScript definitions
- ✅ Core minesweeper mechanics
- ✅ AI concept generation
- ✅ Character-based gameplay
- ✅ Multi-language support
- ✅ Basic UI/UX implementation
- ⏳ Difficulty levels
- ⏳ Character saving
- ⏳ Statistics tracking
- ⏳ Sound effects
- ⏳ Dark mode support
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with Next.js
- UI components from shadcn/ui
- AI powered by Claude via OpenRouter