맥락: - GUI 이식 전에 Rust crate와 proto schema 위치를 Python package 내부에서 분리한다. - Cargo 작업, IDE 인식, 빌드 산출물 관리를 루트 구조에 맞춘다. 변경: - rust_core를 rust/lost-cities-core로 이동하고 proto/lost_cities.proto를 루트 proto 디렉터리로 옮겼다. - Rust build.rs, Python Rust backend, Rust parity 테스트의 경로를 새 위치로 수정했다. - Python package-data에서 Rust crate와 proto 항목을 제거하고 README/port notes를 갱신했다. 확인: - uv sync --extra gui --reinstall-package coolrl-lost-cities - uv run pytest tests/games/classic - uv run lost-cities-classic
61 lines
1.4 KiB
Markdown
61 lines
1.4 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
|
|
```
|
|
|
|
For future GUI work, install the optional GUI dependencies:
|
|
|
|
```bash
|
|
uv sync --extra gui
|
|
```
|
|
|
|
## 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()
|
|
```
|
|
|
|
Rust sources live outside the Python package:
|
|
|
|
```text
|
|
rust/lost-cities-core/
|
|
proto/lost_cities.proto
|
|
```
|
|
|
|
See [classic port notes](docs/classic-port-notes.md) for the current direction.
|