Alba¶
Alba is a hidden-role game for five to ten players, set in Scotland. Most of the players are of the Licht. A few are of the Mirk, and they know each other. Nobody else knows who they are, except the Seer, who must not be found out. Each round, the Constable picks a Band to go on a Quest, the table votes on it, and the Band plays its cards in secret. The Mirk win by failing three Quests, or by finding the Seer at the end.
It is the course's third game because it has the two things a game of secrets needs: things only some players know, and moves made by everyone at once. Those are what this section is about.
The rules¶
Every player, and every bot, is told the rules by the engine, in words made from the same numbers the rules use. Here they are for seven players, exactly as the engine gives them:
/--
info: 7 players: 4 of the Licht, 3 of the Mirk. Everyone knows their own role. The Mirk know each other; the Seer knows who the Mirk are. There are 5 Quests. For each, the Constable proposes a Band (sizes: 2, 3, 3, 4, 4). The table discusses; when everyone has said 'Ready to vote', everyone votes Approve or Reject, and the votes are revealed together. A strict majority approves. If rejected, the next player becomes Constable; 5 rejections in a row and the Mirk win. If approved, each Band member secretly plays Success or Fail; the Licht may only play Success. Only the number of Fails is revealed. A Quest fails if it gets enough Fails (needed, Quest by Quest: 1, 1, 1, 2, 1). 3 failed Quests: the Mirk win. 3 successful Quests: the table talks it over, and once everyone has said 'Ready for the choice', the Headsman names one player; if that is the Seer, the Mirk win, otherwise the Licht win. When the game is over, everyone's role is revealed.
-/
#guard_msgs in
#eval IO.println (rulesText 7)
In short:
- Sides. The Licht against the Mirk. Each player knows their own role. The Mirk know each other. The Seer, of the Licht, knows who the Mirk are. The Headsman is of the Mirk.
- Proposals. The Constable proposes a Band of the size the Quest needs. The table talks it over (in chat, outside the rules) until everyone has said they are ready. Then everyone votes, in secret and in any order, and the votes are revealed together once the last is in. A strict majority approves.
- Rejections. A rejected Band passes the Constable's role to the next player. Too many rejections in a row and the Mirk win.
- Quests. An approved Band plays Success or Fail, in secret and in any order. The Licht may only play Success. Only the number of Fails is revealed, never who played them.
- The end. Three failed Quests and the Mirk win. Three successful Quests, and the table talks once more; then the Headsman names one player. If it is the Seer, the Mirk win; otherwise the Licht do. Every role is then turned face up.
Two sets of names¶
The Lean code never says "Licht", "Seer" or "Band". It uses plain names for
what each thing does in the game: the two sides are the servants and the
minions; the roles are servant, oracle, minion and
assassin; and each round a leader proposes a team for a
quest. Here are the roles, as Games/Alba/Rules.lean defines them:
The names players see are defined once, in the catalogue at the top of
Games/Alba/Game.lean:
def Role.title : Role → String
| .servant => "Thane" | .oracle => "Seer" | .minion => "Conspirator" | .assassin => "Headsman"
/-- A side's name, as it reads after "the": the Licht, the Mirk. -/
def sideTitle (minionSide : Bool) : String := if minionSide then "Mirk" else "Licht"
/-- Words for the parts of the game, renamed in one place. -/
def terms : List (String × String) :=
[("leader", "Constable"), ("quest", "Quest"), ("team", "Band"), ("propose", "Propose"),
("approve", "Approve"), ("reject", "Reject"), ("readyToChoose", "Ready for the choice"),
("success", "Success"), ("fail", "Fail"), ("ready", "Ready to vote"), ("accuse", "Accuse")]
terms is a list of pairs, written (a, b): the mechanic's name and the
word players see. term looks one up:
/-- info: ["Thane", "Seer", "Conspirator", "Headsman"] -/
#guard_msgs in
#eval [Role.servant, .oracle, .minion, .assassin].map (·.title)
/-- info: ("Licht", "Mirk") -/
#guard_msgs in
#eval (sideTitle false, sideTitle true)
/-- info: ["Constable", "Band", "Quest"] -/
#guard_msgs in
#eval ["leader", "team", "quest"].map term
So the rules can be read and proved about in words that say what things do,
and renaming a role is a one-line change in one place, which no rule, proof
or test notices. Games/Alba/NAMES.md records every name, what it stands for
and why it was chosen. In this section, the prose uses the players' names
when it talks about the game, and the code's names when it talks about the
code.
The files¶
| File | What it holds |
|---|---|
Games/Alba/Rules.lean |
The rules: roles, the state of a game, which moves are legal, and step |
Games/Alba/Game.lean |
The catalogue of names, what each player is shown, and the moves offered |
Games/Alba/NAMES.md |
Every player-facing name and where it came from |
Proofs/Alba/Guarantees.lean |
What the rules are proven to ensure, in plain words |
Proofs/Alba/Bookkeeping.lean |
The smaller facts those proofs are built from |
Tests/Alba.lean |
Scenarios for every rule, and thousands of moves of random play |
In this section¶
- The numbers: numbers that depend on the table, matching on numbers, and dealing the roles.
- Votes and quests: moves made by everyone at once, majorities, and quest cards.
- What each player knows: knowledge by role, and the proof that nothing else leaks.
- Changing the rules: changing Alba's numbers and rules, and seeing which guarantees follow and which break.