Ordstirr Game Rules Engine

Rules come only from public-domain books: Babcock's Rules for Mah-Jongg (1923) and Linnaeus's 1732 account of Tablut (Latin text as printed 1889; English translation 1811). Where the old text is unclear, the reading used is named in the response. Not an official ruling of any league or federation.

Terms of service: informational only, as is, refund limited to the price of the call. Refund requests: li8ertyapps@gmail.com.

POST /v1/babcock/score $0.02

Score a mahjong hand under Babcock's 1923 Rules for Mah-Jongg (public domain), with a page citation for every line

{
  "tiles": "Gd Gd Gd Wd Wd EEE 234c",
  "table": [
    {
      "type": "kong",
      "tile": "8d"
    }
  ],
  "seat_wind": "E",
  "mahjong": true,
  "winning_tile": "Gd",
  "win_by": "discard"
}

POST /v1/babcock/settle $0.01

Settle one hand of Babcock 1923 Mah-Jongg: who pays whom, with East paying and receiving double

{
  "scores": {
    "E": 48,
    "S": 16,
    "W": 4,
    "N": 0
  },
  "winner": "E"
}

POST /v1/tafl/moves $0.02

List every legal move in a Tablut position (Linnaeus 1732, public domain), with the king's open roads (raichi/tuichu)

{
  "rules": "linnaeus_1811",
  "board": "start",
  "to_move": "muscovites",
  "from": "d9"
}

POST /v1/tafl/check-move $0.02

Referee one Tablut move (Linnaeus 1732, public domain): legal or not and why, captures, king escaped or taken, the board after

{
  "rules": "linnaeus_1811",
  "board": "start",
  "to_move": "muscovites",
  "move": "d9-d6"
}

Paid with x402 (USDC). Unpaid calls get HTTP 402 with payment terms. Invalid input gets HTTP 400 and is never charged.