Metadata-Version: 2.4
Name: snake-game-cli
Version: 0.3.1
Summary: Play snake game in your terminal.
Project-URL: Homepage, https://github.com/wang-hz/snake-game-cli
Author-email: "Wang H.Z." <imwanghz@gmail.com>
License-File: LICENSE
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.10
Requires-Dist: windows-curses; sys_platform == 'win32'
Description-Content-Type: text/markdown

# snake-game-cli

Play snake game in your terminal.

![demo](https://raw.githubusercontent.com/wang-hz/snake-game-cli/main/demo.svg)

## Installation

```shell
pip install snake-game-cli
```

## Usage

```shell
play-snake                 # start at Normal difficulty
play-snake -d hard         # or easy / normal / hard
```

You can also pick the difficulty on the start screen with `←` / `→`, then press `Enter` to begin.

## Controls

| Key | Action |
|-----|--------|
| `↑` / `W` | Move up |
| `↓` / `S` | Move down |
| `←` / `A` | Move left |
| `→` / `D` | Move right |
| `P` | Pause / Resume |
| `Q` | Quit |

On the start screen, `←` / `→` change the difficulty and `Enter` starts the game.

## Features

- Three difficulty presets (easy / normal / hard), selectable via `-d` or on the start screen
- Restarting after game over returns to the difficulty selector, so you can switch presets between runs
- Snake speeds up as your score increases
- High score persists across sessions
- Pressing a direction key triggers an immediate move
- Terminal resize is handled gracefully

## Development

Checks run automatically before every `git push` via a tracked `pre-push` hook.
Enable it once after cloning:

```shell
git config core.hooksPath .githooks
```

The hook runs the same checks on your local Python and blocks the push if any fail:

```shell
ruff check .
ruff format --check .
mypy snake_game_cli.py
pytest
```

Bypass it in an emergency with `git push --no-verify`.

On release (pushing a `v*` tag), GitHub Actions runs the test suite across Python
3.10–3.13 and only publishes to PyPI if every version passes.
