Skip to main content

i151-engine

Moteur de jeu headless pour la compétition IA i151 : règles du jeu de cartes, matchs bot vs bot reproductibles, replays JSON.

Étudiants : installez plutôt i151-arena-sdk — ce moteur y est inclus comme dépendance, avec la CLI arena et les outils de soumission.

Prérequis : Python 3.11+

Installation

pip install i151-engine

Développement (monorepo) :

pip install -e ".[dev]"
pytest

Usage

from i151_engine.bots.random_bot import RandomBot
from i151_engine.runner.config import MatchConfig
from i151_engine.runner.match_runner import play_match

result = play_match(
    RandomBot(),
    "builtin:random",
    MatchConfig(seed=42, target_score=151, cards_per_player=8),
)
print(result.reason, result.winner_id, result.final_scores)

Fonctionnalités

Module Rôle
models/ Cartes, actions, état joueur
core/ Règles, actions légales, réducteur, scores
game/ Manches, parties, enregistreur de replay
view/ PlayerView — perspective partielle pour les bots
opponents/ Catalogue d'adversaires (builtin:random, …)
runner/ play_match, timeouts, forfaits

v1 : 2 joueurs, partie jusqu'à 151 points, RNG seedé, un adversaire intégré actif (builtin:random).

Adversaires

Les matchs référencent un opponent_id stable (ex. builtin:random). Le catalogue complet est dans i151_engine.opponents.catalog ; seuls les adversaires implemented=True sont jouables.

Interface bot

class Bot(Protocol):
    def setup(self, submission_dir: Path) -> None: ...
    def decide(self, view: PlayerView, legal_actions: list[Action], time_left_ms: int) -> Action: ...
    def teardown(self) -> None: ...

Les bots étudiants implémentent decide() via le SDK (arena_sdk), pas directement ce protocole.

Documentation

Ressource Lien
SDK étudiant i151-arena-sdk sur PyPI
Tutoriel i151.djamma.dev/docs/tutorial
Architecture détaillée i151.djamma.dev/docs/architecture

Documentation technique interne (monorepo) : ARCHITECTURE.md.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

i151_engine-0.2.3.tar.gz (38.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

i151_engine-0.2.3-py3-none-any.whl (28.1 kB view details)

Uploaded Python 3

File details

Details for the file i151_engine-0.2.3.tar.gz.

File metadata

  • Download URL: i151_engine-0.2.3.tar.gz
  • Upload date:
  • Size: 38.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for i151_engine-0.2.3.tar.gz
Algorithm Hash digest
SHA256 1c7e777d460278642ba1245d75e6a98819d1d3fa31c0b36a7423249d7203e04d
MD5 0fc5bfbeddbfc0a871a615efa9595611
BLAKE2b-256 2a68dae841fee4dac7705393cd57e9dbca286dc04519b5aa84ff637bbe4e304c

See more details on using hashes here.

File details

Details for the file i151_engine-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: i151_engine-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 28.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for i151_engine-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b4bfb5f5ff4ee555510b49c416be357624a61d691ef8cdfa470a6d94c2824115
MD5 16b2cb77a174278f3c8da900870b8626
BLAKE2b-256 cfc03c7e9073dc25919de28a63ac558f9ea54fd0f022e2d2c5adb697e1242c73

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page