Skip to main content

Rules

Rules define what counts as a legal move: connectivity, anchors, cross-checks, stack constraints, and scoring bonuses. Use the lightweight visual below, then open the full Playground to try end‑to‑end moves.

Rules demo
Legal anchors and toggles (visual).
anchor
anchor
★ center
anchor
anchor
Adjacency
Legal directions: N/E/S/W. First move must cover center.
Dictionary checks are disabled. Stacking is OFF.

Move pipeline at a glance

  1. Draft — A player proposes placements (MoveDraft) via UI or binding helpers.
  2. Validate — The active Rules implementation enforces connectivity, dictionary checks, stack constraints, and custom plugin hooks.
  3. Score — Once validated, the pipeline computes base word scores, cross scores, bingo bonuses, and stack multipliers.
  4. Commit — The move is applied, events are logged, racks refill, and the turn advances.

The default CrosswordRules mirrors classic crossword connectivity, but you can override any step by implementing the RulePlugin trait or by toggling the provided features (free_word_mode, diagonal edges, stacking policies, etc.).

Configuration surface

  • ruleset_id selects a preset (currently cross for classic crossword play). Use rule toggles to configure stacking and relaxed adjacency variants.
  • The Playground and bindings expose set_free_word_mode to bypass dictionaries during prototyping.
  • set_stacking flips stacking on/off and tunes the max height and scoring model.
  • Rule plugins can veto or post-process moves, making it easy to inject house rules (swap tiles, bonus cards, wild marks) without patching the core engine.
Registering a custom plugin
game_rules.add_plugin(Box::new(HeptagonBonus::default()));
game_rules.add_plugin(Box::new(WordLengthCap::new(10)));

Plugins run in order, and each one receives the draft, validation context, and scoring metadata so they can safely augment or reject the move. Combined with graph geometry and custom lexica, almost any word game variant can be expressed without forking the engine.

Dive deeper