Expand description
A deterministic, hidden-information Daifugo engine for humans and humanoids.
piech gives every controller the same observation/action interface. A
PlayerView exposes the requesting player’s hand, public pile state,
opponent hand counts, and legal actions—never opponents’ cards.
Version 0.1 models singles and same-rank groups, optional joker wildcards, revolution, eight-cut, and spade-three-over-joker. Daifugo has many regional rules; unsupported rules such as straights and suit lock are intentionally not inferred.
§Example
use piech::{Action, Controller, Game, Player, Rules};
let players = [
Player::new("us", Controller::Human)?,
Player::new("robot", Controller::Humanoid)?,
];
let mut game = Game::deal(players, piech::standard_deck(1)?, Rules::default())?;
let current = game.current_player_id().unwrap().to_owned();
let action = game.view_for(¤t)?.legal_actions()[0].clone();
game.apply(¤t, action)?;Structs§
- Game
- Deterministic Daifugo game state.
- Meld
- An analyzed single or same-rank group.
- Opponent
View - Public information about another seat.
- Player
- A public player seat definition.
- Player
View - Information legally visible to one player controller.
- Rules
- Configurable rules supported by this engine version.
Enums§
- Action
- A controller action.
- Card
- A unique suited card or numbered joker.
- Controller
- Who controls a player seat.
- Error
- Game setup, action, and rule errors.
- Game
Phase - Public phase of the game.
- Rank
- Daifugo rank order before revolution: 3 is lowest and 2 is highest.
- Step
Error - Failure while asking an
Agentto take one turn. - Suit
- A standard French-suited card suit.
Traits§
- Agent
- A human UI, humanoid controller, or software agent that chooses one action from a hidden-information player view.
Functions§
- standard_
deck - Builds an ordered 52-card deck followed by
joker_countunique jokers.