minesweeper-cli


Nameminesweeper-cli JSON
Version 1.0.0 PyPI version JSON
download
home_pageNone
SummaryClassic Minesweeper game for the terminal with colorful CLI interface
upload_time2025-09-13 05:46:38
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseGPL-3.0
keywords minesweeper game cli terminal puzzle
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Minesweeper CLI ๐Ÿ’ฃ

Classic Minesweeper game for the terminal, built with Python. Features colorful interface, multiple difficulty levels, and intuitive commands.

## ๐ŸŽฎ Game Preview

```
    A B C D E F G H
  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
1 โ”‚ โฌ› โฌ› โฌ› โฌ› โฌ› โฌ› โฌ› โฌ› โ”‚
2 โ”‚ ยท 1  1  2  โฌ› โฌ› โฌ› โฌ› โ”‚
3 โ”‚ ยท 1  ๐Ÿšฉ 2  โฌ› โฌ› โฌ› โฌ› โ”‚
4 โ”‚ ยท 1  1  2  โฌ› โฌ› โฌ› โฌ› โ”‚
5 โ”‚ ยท ยท  ยท  1  โฌ› โฌ› โฌ› โฌ› โ”‚
6 โ”‚ 1 1  ยท  ยท  โฌ› โฌ› โฌ› โฌ› โ”‚
7 โ”‚ โฌ› 1  ยท  ยท  โฌ› โฌ› โฌ› โฌ› โ”‚
8 โ”‚ โฌ› 1  ยท  ยท  โฌ› โฌ› โฌ› โฌ› โ”‚
  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Banderas: 1/10  Tiempo: 2:34

> reveal D5
```

## ๐Ÿš€ Installation

### Using uv (recommended)

```bash
# Install uv if you haven't already
curl -LsSf https://astral.sh/uv/install.sh | sh

# Create virtual environment and install
uv venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
uv pip install -e .
```

### Using pip

```bash
# Create virtual environment
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Install in development mode
pip install -e .
```

### For Users (when published to PyPI)

```bash
pip install minesweeper-cli
```

## ๐ŸŽฏ Usage

### Basic Commands

```bash
# Run with default easy level
minesweeper

# Run with specific difficulty
minesweeper --level medium
minesweeper --level hard

# Show version
minesweeper --version

# Show help
minesweeper --help
```

### Difficulty Levels

| Level | Grid Size | Mines | Description |
|-------|-----------|-------|-------------|
| **Easy** | 8ร—8 | 10 | Perfect for beginners |
| **Medium** | 16ร—16 | 40 | Balanced challenge |
| **Hard** | 30ร—16 | 99 | Expert level |

## ๐ŸŽฎ How to Play

### In-Game Commands

| Command | Aliases | Example | Description |
|---------|---------|---------|-------------|
| `reveal <coord>` | `r <coord>` | `reveal A1` | Reveal a cell |
| `flag <coord>` | `f <coord>` | `flag B3` | Place/remove flag |
| `help` | `h`, `?` | `help` | Show help screen |
| `quit` | `q` | `quit` | Exit game |
| `new` | `n` | `new` | New game (end game only) |

### Coordinate System

- **Columns**: Letters (A-Z, then AA-AZ, BA-BZ, etc.)
- **Rows**: Numbers (1, 2, 3, ...)
- **Format**: Letter + Number

**Examples**: `A1`, `B3`, `AA15`, `AD30`

### Game Symbols

| Symbol | Meaning | Color |
|--------|---------|-------|
| โฌ› | Unrevealed cell | Blue |
| ยท | Empty revealed cell | White |
| ๐Ÿšฉ | Flag | - |
| ๐Ÿ’ฅ | Exploded mine | - |
| ๐Ÿ’ฃ | Mine (shown when game ends) | Red |
| 1-8 | Adjacent mine count | Various* |

*Number colors: 1=Cyan, 2=Green, 3=Yellow, 4=Magenta, 5=Red, 6=Cyan, 7=White, 8=Red

### Gameplay Rules

1. **Goal**: Reveal all cells that don't contain mines
2. **Numbers**: Show how many mines are adjacent to that cell
3. **Flags**: Use to mark suspected mine locations
4. **Cascade**: Empty cells automatically reveal adjacent empty areas
5. **Game Over**: Revealing a mine ends the game
6. **Victory**: Reveal all non-mine cells to win

## ๐Ÿ“‹ Game Examples

### Easy Game Session

```
    A B C D E F G H
  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
1 โ”‚ 1  1  ยท  ยท  ยท  ยท  1  โฌ› โ”‚
2 โ”‚ ๐Ÿ’ฃ 1  ยท  ยท  ยท  ยท  1  โฌ› โ”‚
3 โ”‚ 1  1  ยท  ยท  ยท  ยท  1  โฌ› โ”‚
4 โ”‚ ยท  ยท  ยท  ยท  ยท  ยท  1  โฌ› โ”‚
5 โ”‚ ยท  ยท  ยท  ยท  ยท  ยท  1  โฌ› โ”‚
6 โ”‚ ยท  ยท  ยท  ยท  ยท  ยท  1  โฌ› โ”‚
7 โ”‚ 1  1  1  1  1  1  2  โฌ› โ”‚
8 โ”‚ โฌ› โฌ› โฌ› โฌ› โฌ› โฌ› โฌ› โฌ› โ”‚
  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

ยกBOOM! 
Pisaste una mina en A2

Banderas encontradas: 0/10
Tiempo total: 1:23

[N]ueva partida
[S]alir
```

### Victory Screen

```
ยกGANASTE! ๐ŸŽ‰

Todas las minas encontradas
Tiempo: 5:23

[N]ueva partida
[S]alir
```

## ๐Ÿ› ๏ธ Development

### Setup Development Environment

```bash
# Clone repository
git clone <repository-url>
cd minesweeper-cli

# Setup with uv (recommended)
uv venv
source .venv/bin/activate
uv pip install -e .

# Or setup with pip
python -m venv .venv
source .venv/bin/activate
pip install -e .
```

### Run Tests

```bash
# When tests are implemented
uv run pytest tests/

# Code quality checks
uv run flake8 src/
uv run black src/ --check
uv run mypy src/
```

### Project Structure

```
minesweeper-cli/
โ”œโ”€โ”€ src/
โ”‚   โ””โ”€โ”€ minesweeper/
โ”‚       โ”œโ”€โ”€ __init__.py
โ”‚       โ”œโ”€โ”€ main.py          # CLI entry point and main game loop
โ”‚       โ”œโ”€โ”€ game.py          # Game logic and state management
โ”‚       โ”œโ”€โ”€ models.py        # Data structures (Cell, Board, GameState)
โ”‚       โ”œโ”€โ”€ renderer.py      # Display and visualization
โ”‚       โ””โ”€โ”€ commands.py      # Command parsing and validation
โ”œโ”€โ”€ examples/
โ”‚   โ””โ”€โ”€ play_example.py      # Programmatic usage examples
โ”œโ”€โ”€ tests/                   # Test files (to be implemented)
โ”œโ”€โ”€ docs/                    # Design documents
โ”œโ”€โ”€ pyproject.toml          # Project configuration
โ”œโ”€โ”€ README.md               # This file
โ””โ”€โ”€ LICENSE                 # MIT License
```

## ๐Ÿงฉ Examples

See `examples/play_example.py` for programmatic usage:

```bash
python examples/play_example.py
```

This shows how to:
- Create games programmatically
- Make automated moves
- Integrate game logic into other applications

## ๐Ÿ”ง Requirements

- Python 3.9 or higher
- Click 8.0+ (CLI framework)
- Colorama 0.4+ (terminal colors)

## ๐Ÿ“œ License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## ๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

### Current Features โœ…

- [x] Three difficulty levels (Easy, Medium, Hard)
- [x] Colorful terminal interface
- [x] Intuitive command system
- [x] Flag placement and removal
- [x] Cascade reveal for empty areas
- [x] Win/lose detection
- [x] Game timer
- [x] Cross-platform support

### Future Enhancements ๐Ÿš€

- [ ] Save/load game state
- [ ] Statistics and best times
- [ ] Custom difficulty levels
- [ ] Hint system
- [ ] ASCII animations
- [ ] Sound effects (terminal beeps)
- [ ] Multiplayer mode
- [ ] No-guess guaranteed mode

## ๐Ÿ“ž Support

If you encounter any issues or have questions:

1. Check the in-game help: `help` command
2. Review this README
3. Check the examples in `examples/`
4. Open an issue on GitHub

---

**Happy Minesweeping! ๐Ÿ’ฃ๐ŸŽฎ**

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "minesweeper-cli",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "minesweeper, game, cli, terminal, puzzle",
    "author": null,
    "author_email": "\"Javier Novoa C.\" <jstitch@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/d0/2f/ebf716af3fb05d7c4daa4aa3540974876490ba38d2b2cdf6342b5a513013/minesweeper_cli-1.0.0.tar.gz",
    "platform": null,
    "description": "# Minesweeper CLI \ud83d\udca3\n\nClassic Minesweeper game for the terminal, built with Python. Features colorful interface, multiple difficulty levels, and intuitive commands.\n\n## \ud83c\udfae Game Preview\n\n```\n    A B C D E F G H\n  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n1 \u2502 \u2b1b \u2b1b \u2b1b \u2b1b \u2b1b \u2b1b \u2b1b \u2b1b \u2502\n2 \u2502 \u00b7 1  1  2  \u2b1b \u2b1b \u2b1b \u2b1b \u2502\n3 \u2502 \u00b7 1  \ud83d\udea9 2  \u2b1b \u2b1b \u2b1b \u2b1b \u2502\n4 \u2502 \u00b7 1  1  2  \u2b1b \u2b1b \u2b1b \u2b1b \u2502\n5 \u2502 \u00b7 \u00b7  \u00b7  1  \u2b1b \u2b1b \u2b1b \u2b1b \u2502\n6 \u2502 1 1  \u00b7  \u00b7  \u2b1b \u2b1b \u2b1b \u2b1b \u2502\n7 \u2502 \u2b1b 1  \u00b7  \u00b7  \u2b1b \u2b1b \u2b1b \u2b1b \u2502\n8 \u2502 \u2b1b 1  \u00b7  \u00b7  \u2b1b \u2b1b \u2b1b \u2b1b \u2502\n  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n\nBanderas: 1/10  Tiempo: 2:34\n\n> reveal D5\n```\n\n## \ud83d\ude80 Installation\n\n### Using uv (recommended)\n\n```bash\n# Install uv if you haven't already\ncurl -LsSf https://astral.sh/uv/install.sh | sh\n\n# Create virtual environment and install\nuv venv\nsource .venv/bin/activate  # On Windows: .venv\\Scripts\\activate\nuv pip install -e .\n```\n\n### Using pip\n\n```bash\n# Create virtual environment\npython -m venv .venv\nsource .venv/bin/activate  # On Windows: .venv\\Scripts\\activate\n\n# Install in development mode\npip install -e .\n```\n\n### For Users (when published to PyPI)\n\n```bash\npip install minesweeper-cli\n```\n\n## \ud83c\udfaf Usage\n\n### Basic Commands\n\n```bash\n# Run with default easy level\nminesweeper\n\n# Run with specific difficulty\nminesweeper --level medium\nminesweeper --level hard\n\n# Show version\nminesweeper --version\n\n# Show help\nminesweeper --help\n```\n\n### Difficulty Levels\n\n| Level | Grid Size | Mines | Description |\n|-------|-----------|-------|-------------|\n| **Easy** | 8\u00d78 | 10 | Perfect for beginners |\n| **Medium** | 16\u00d716 | 40 | Balanced challenge |\n| **Hard** | 30\u00d716 | 99 | Expert level |\n\n## \ud83c\udfae How to Play\n\n### In-Game Commands\n\n| Command | Aliases | Example | Description |\n|---------|---------|---------|-------------|\n| `reveal <coord>` | `r <coord>` | `reveal A1` | Reveal a cell |\n| `flag <coord>` | `f <coord>` | `flag B3` | Place/remove flag |\n| `help` | `h`, `?` | `help` | Show help screen |\n| `quit` | `q` | `quit` | Exit game |\n| `new` | `n` | `new` | New game (end game only) |\n\n### Coordinate System\n\n- **Columns**: Letters (A-Z, then AA-AZ, BA-BZ, etc.)\n- **Rows**: Numbers (1, 2, 3, ...)\n- **Format**: Letter + Number\n\n**Examples**: `A1`, `B3`, `AA15`, `AD30`\n\n### Game Symbols\n\n| Symbol | Meaning | Color |\n|--------|---------|-------|\n| \u2b1b | Unrevealed cell | Blue |\n| \u00b7 | Empty revealed cell | White |\n| \ud83d\udea9 | Flag | - |\n| \ud83d\udca5 | Exploded mine | - |\n| \ud83d\udca3 | Mine (shown when game ends) | Red |\n| 1-8 | Adjacent mine count | Various* |\n\n*Number colors: 1=Cyan, 2=Green, 3=Yellow, 4=Magenta, 5=Red, 6=Cyan, 7=White, 8=Red\n\n### Gameplay Rules\n\n1. **Goal**: Reveal all cells that don't contain mines\n2. **Numbers**: Show how many mines are adjacent to that cell\n3. **Flags**: Use to mark suspected mine locations\n4. **Cascade**: Empty cells automatically reveal adjacent empty areas\n5. **Game Over**: Revealing a mine ends the game\n6. **Victory**: Reveal all non-mine cells to win\n\n## \ud83d\udccb Game Examples\n\n### Easy Game Session\n\n```\n    A B C D E F G H\n  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n1 \u2502 1  1  \u00b7  \u00b7  \u00b7  \u00b7  1  \u2b1b \u2502\n2 \u2502 \ud83d\udca3 1  \u00b7  \u00b7  \u00b7  \u00b7  1  \u2b1b \u2502\n3 \u2502 1  1  \u00b7  \u00b7  \u00b7  \u00b7  1  \u2b1b \u2502\n4 \u2502 \u00b7  \u00b7  \u00b7  \u00b7  \u00b7  \u00b7  1  \u2b1b \u2502\n5 \u2502 \u00b7  \u00b7  \u00b7  \u00b7  \u00b7  \u00b7  1  \u2b1b \u2502\n6 \u2502 \u00b7  \u00b7  \u00b7  \u00b7  \u00b7  \u00b7  1  \u2b1b \u2502\n7 \u2502 1  1  1  1  1  1  2  \u2b1b \u2502\n8 \u2502 \u2b1b \u2b1b \u2b1b \u2b1b \u2b1b \u2b1b \u2b1b \u2b1b \u2502\n  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n\n\u00a1BOOM! \nPisaste una mina en A2\n\nBanderas encontradas: 0/10\nTiempo total: 1:23\n\n[N]ueva partida\n[S]alir\n```\n\n### Victory Screen\n\n```\n\u00a1GANASTE! \ud83c\udf89\n\nTodas las minas encontradas\nTiempo: 5:23\n\n[N]ueva partida\n[S]alir\n```\n\n## \ud83d\udee0\ufe0f Development\n\n### Setup Development Environment\n\n```bash\n# Clone repository\ngit clone <repository-url>\ncd minesweeper-cli\n\n# Setup with uv (recommended)\nuv venv\nsource .venv/bin/activate\nuv pip install -e .\n\n# Or setup with pip\npython -m venv .venv\nsource .venv/bin/activate\npip install -e .\n```\n\n### Run Tests\n\n```bash\n# When tests are implemented\nuv run pytest tests/\n\n# Code quality checks\nuv run flake8 src/\nuv run black src/ --check\nuv run mypy src/\n```\n\n### Project Structure\n\n```\nminesweeper-cli/\n\u251c\u2500\u2500 src/\n\u2502   \u2514\u2500\u2500 minesweeper/\n\u2502       \u251c\u2500\u2500 __init__.py\n\u2502       \u251c\u2500\u2500 main.py          # CLI entry point and main game loop\n\u2502       \u251c\u2500\u2500 game.py          # Game logic and state management\n\u2502       \u251c\u2500\u2500 models.py        # Data structures (Cell, Board, GameState)\n\u2502       \u251c\u2500\u2500 renderer.py      # Display and visualization\n\u2502       \u2514\u2500\u2500 commands.py      # Command parsing and validation\n\u251c\u2500\u2500 examples/\n\u2502   \u2514\u2500\u2500 play_example.py      # Programmatic usage examples\n\u251c\u2500\u2500 tests/                   # Test files (to be implemented)\n\u251c\u2500\u2500 docs/                    # Design documents\n\u251c\u2500\u2500 pyproject.toml          # Project configuration\n\u251c\u2500\u2500 README.md               # This file\n\u2514\u2500\u2500 LICENSE                 # MIT License\n```\n\n## \ud83e\udde9 Examples\n\nSee `examples/play_example.py` for programmatic usage:\n\n```bash\npython examples/play_example.py\n```\n\nThis shows how to:\n- Create games programmatically\n- Make automated moves\n- Integrate game logic into other applications\n\n## \ud83d\udd27 Requirements\n\n- Python 3.9 or higher\n- Click 8.0+ (CLI framework)\n- Colorama 0.4+ (terminal colors)\n\n## \ud83d\udcdc License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## \ud83e\udd1d Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n### Current Features \u2705\n\n- [x] Three difficulty levels (Easy, Medium, Hard)\n- [x] Colorful terminal interface\n- [x] Intuitive command system\n- [x] Flag placement and removal\n- [x] Cascade reveal for empty areas\n- [x] Win/lose detection\n- [x] Game timer\n- [x] Cross-platform support\n\n### Future Enhancements \ud83d\ude80\n\n- [ ] Save/load game state\n- [ ] Statistics and best times\n- [ ] Custom difficulty levels\n- [ ] Hint system\n- [ ] ASCII animations\n- [ ] Sound effects (terminal beeps)\n- [ ] Multiplayer mode\n- [ ] No-guess guaranteed mode\n\n## \ud83d\udcde Support\n\nIf you encounter any issues or have questions:\n\n1. Check the in-game help: `help` command\n2. Review this README\n3. Check the examples in `examples/`\n4. Open an issue on GitHub\n\n---\n\n**Happy Minesweeping! \ud83d\udca3\ud83c\udfae**\n",
    "bugtrack_url": null,
    "license": "GPL-3.0",
    "summary": "Classic Minesweeper game for the terminal with colorful CLI interface",
    "version": "1.0.0",
    "project_urls": {
        "BugTracker": "https://github.com/example/minesweeper-cli/issues",
        "Documentation": "https://github.com/example/minesweeper-cli#readme",
        "Homepage": "https://github.com/example/minesweeper-cli",
        "Repository": "https://github.com/example/minesweeper-cli"
    },
    "split_keywords": [
        "minesweeper",
        " game",
        " cli",
        " terminal",
        " puzzle"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "74aede8cf8d7e65b73bed699b3d57835e44c2c16a2d8f1714ea1214de6fa0109",
                "md5": "1a7e38691cb69f982ad6f79393e8e11e",
                "sha256": "0959a717a6f5139c0714af362e9f742a73c85d8954a97d92ffab57a475da49d3"
            },
            "downloads": -1,
            "filename": "minesweeper_cli-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1a7e38691cb69f982ad6f79393e8e11e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 26206,
            "upload_time": "2025-09-13T05:46:36",
            "upload_time_iso_8601": "2025-09-13T05:46:36.565284Z",
            "url": "https://files.pythonhosted.org/packages/74/ae/de8cf8d7e65b73bed699b3d57835e44c2c16a2d8f1714ea1214de6fa0109/minesweeper_cli-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "d02febf716af3fb05d7c4daa4aa3540974876490ba38d2b2cdf6342b5a513013",
                "md5": "c228a31ddb42639fdc6299d4df039734",
                "sha256": "f07bb827a5da374f6176f3ea5b0a8f843a63cfcaef4576381e57576f123f97d8"
            },
            "downloads": -1,
            "filename": "minesweeper_cli-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "c228a31ddb42639fdc6299d4df039734",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 27168,
            "upload_time": "2025-09-13T05:46:38",
            "upload_time_iso_8601": "2025-09-13T05:46:38.189643Z",
            "url": "https://files.pythonhosted.org/packages/d0/2f/ebf716af3fb05d7c4daa4aa3540974876490ba38d2b2cdf6342b5a513013/minesweeper_cli-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-09-13 05:46:38",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "example",
    "github_project": "minesweeper-cli",
    "github_not_found": true,
    "lcname": "minesweeper-cli"
}
        
Elapsed time: 2.18914s