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.2.tar.gz (36.7 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.2-py3-none-any.whl (27.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: i151_engine-0.2.2.tar.gz
  • Upload date:
  • Size: 36.7 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.2.tar.gz
Algorithm Hash digest
SHA256 7a7a2d3ffe355e280029649e977c0d08bd8c7bf1833e9b39d1ab73f22df39264
MD5 491e07dea6c9dbae69391d330847d586
BLAKE2b-256 7dcfa38c2b7a9da6a89308e53ab1f8cf2f3f149163ce7b190dcc6def8e76f536

See more details on using hashes here.

File details

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

File metadata

  • Download URL: i151_engine-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 27.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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b37356f34887d6b303ff2df00376345ed86056c63d3301c3104eb2aa79d101fc
MD5 922f45b820f785e56447693b600f4886
BLAKE2b-256 42cbad8df3d15953ec6e11f3f3e48c5ea329129bc7201b700adb75813090552e

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