Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,13 @@ done by running 1000 (when possible) 1v1 games against previous in list.

## Developing for Catanatron

To develop for Catanatron core logic you can use the following test suite:
To develop for Catanatron core logic install the developer dependencies:

```bash
pip install -r dev-requirements.txt
```

Then you can run the tests with:

```bash
coverage run --source=catanatron -m pytest tests/ && coverage report
Expand All @@ -211,7 +217,7 @@ Generate JSON files with complete information about games and decisions by runni
catanatron-play --num=100 --output=my-data-path/ --json
```

Similarly (with Tensorflow installed) you can generate several GZIP CSVs of a basic set of features:
Similarly (with `tensorflow` installed) you can generate several GZIP CSVs of a basic set of features:

```bash
catanatron-play --num=100 --output=my-data-path/ --csv
Expand Down Expand Up @@ -249,7 +255,7 @@ Ensure you are inside a virtual environment with all dependencies installed and
use `flask run`.

```bash
python3.8 -m venv venv
python -m venv venv
source ./venv/bin/activate
pip install -r requirements.txt

Expand Down

@pachewise pachewise May 7, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thematically, I think it's good. Stylistically - maybe make it smaller, and add a border to it? (Also, curious about the blue color?)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed 💯 I'd say it's a little too big. I asked claude to generate a color scheme and the secondary accent color matches almost exactly 🤣 It's always been hard to work around the traditional color scheme and make it feel cyberpunk-y because the player colors and resource colors clash no matter how what.

image

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
██████ █████ ████████ █████ ███ ██ █████ ████████ ██████ ██████ ███ ██
██ ██ ██ ██ ██ ██ ████ ██ ██ ██ ██ ██ ██ ██ ██ ████ ██
██ ███████ ██ ███████ ██ ██ ██ ███████ ██ ██████ ██ ██ ██ ██ ██
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
██████ ██ ██ ██ ██ ██ ██ ████ ██ ██ ██ ██ ██ ██████ ██ ████

13 changes: 13 additions & 0 deletions catanatron_experimental/catanatron_experimental/play.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ def simulate(
players.append(player)
break

print_banner()
output_options = OutputOptions(output, csv, json, db)
game_config = GameConfigOptions(config_discard_limit, config_vps_to_win, config_map)
play_batch(
Expand All @@ -189,6 +190,18 @@ def simulate(
)


def print_banner():
with open(f"{os.path.dirname(__file__)}/cli/banner.txt", "r") as banner_file:
banner = banner_file.read()
console.print(
Text.from_markup(f"[blue]{banner}[/blue]"),
justify="center",
highlight=False,
overflow="ignore",
soft_wrap=True,
)


@dataclass(frozen=True)
class OutputOptions:
"""Class to keep track of output CLI flags"""
Expand Down