Files
coorl-lost-cities/README.md
T
coolguy 361420df7a 클래식 공개 API 정리
맥락:
- GUI 이식 전에 classic 패키지 루트에서 노출할 API 범위를 정리했다.
- Claude Opus 4.7 xhigh 자문에서 root export 축소와 backend builder 이름 단일화를 우선 권장했다.

변경:
- classic package root export를 GameState, config, env, backend, bot registry 중심으로 줄였다.
- backend factory 이름을 build_backend로 단일화하고 README 사용 예시를 갱신했다.
- public API smoke test를 추가하고 pyproject description 및 Cython build failure 처리를 정리했다.

확인:
- uv run pytest tests/games/classic
- uv run lost-cities-classic
2026-05-06 19:21:17 +09:00

48 lines
1.2 KiB
Markdown

# coolrl-lost-cities
Focused Lost Cities extraction from the legacy `coolrl` repository.
The current implementation starts with the classic two-player card game:
- classic 5-expedition rules by default
- Python/Cython game engine
- Rust core parity checks
- env wrapper
- random, passive-discard, and safe-heuristic bots
- core rule, scoring, mask, env, canonical-state, bot, and Rust parity tests
Training code, Deep CFR, learned-policy evaluation, GUI, and web client are
intentionally outside the first port.
## Development
```bash
uv run pytest tests/games/classic
uv run lost-cities-classic
```
## Basic Usage
```python
from coolrl_lost_cities.games.classic import GameState, build_bot, classic_config
state = GameState.new_game(classic_config(seed=1))
bot = build_bot("random", seed=1)
while not state.terminal:
state.apply_action(bot.act(state))
print(state.total_score(0), state.total_score(1))
```
Backends use the same snapshot/apply/undo interface:
```python
from coolrl_lost_cities.games.classic import build_backend, classic_config
backend = build_backend("python", classic_config(), seed=1)
snapshot = backend.snapshot()
```
See [classic port notes](docs/classic-port-notes.md) for the current direction.