Skip to content

Latest commit

 

History

History
83 lines (55 loc) · 1.56 KB

File metadata and controls

83 lines (55 loc) · 1.56 KB

The 2048 Game

A CLI implementation of the 2048 game, written in Python.

Getting started

Installation

If you have pipx installed:

pipx install git@github.com:clifflau1120/python-2048.git

or you can build from source with uv:

git clone git@github.com:clifflau1120/python-2048.git
cd python-2048

uv python install 3.13               # install Python 3.13
uv python pin 3.13                   # pin Python 3.13
uv venv                              # create a virtual environment
source .venv/bin/activate            # activate the virtual environment
uv sync --locked --all-extras --dev  # sync dependencies to the virtual environment

Run the game

To start a new game:

python-2048 run

To continue from a previously saved snapshot:

python-2048 run <game_snapshot_path>

To enable LLM-based suggestion, as supported by pydantic_ai:

python-2048 run --model <model_name>

To observe how an LLM plays 2048:

python-2048 run --impersonate --model <model_name>

Contributing

This repository uses ruff for formatting and linting:

ruff format
ruff check

... and pyright for type checking:

pyright

... as well as pytest for testing:

pytest

You can install pre-commit hooks so that code quality is verified on each commit:

pre-commit install

Versioning

This repository uses calendar versioning.