diff --git a/war/root/games/kalaha5x2x3/METADATA b/war/root/games/kalaha5x2x3/METADATA new file mode 100644 index 0000000..667b957 --- /dev/null +++ b/war/root/games/kalaha5x2x3/METADATA @@ -0,0 +1,7 @@ +{ + "gameName": "Kalah 5x2x3", + "rulesheet": "kalah.kif", + "description": "kalah.txt", + "stylesheet": "kalah.xsl", + "curator": "arr" +} diff --git a/war/root/games/kalaha5x2x3/kalah.kif b/war/root/games/kalaha5x2x3/kalah.kif new file mode 100644 index 0000000..b23e00a --- /dev/null +++ b/war/root/games/kalaha5x2x3/kalah.kif @@ -0,0 +1,524 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; +;;; Kalah (a.k.a. Kalaha and Mancala). +;;; +;;; 5 pits, 3 seeds. +;;; +;;; /--------------------------------\ +;;; | | | | | | | | +;;; | N | 10 | 9 | 8 | 7 | 6 | S | +;;; | O | | | | | | O | +;;; | R |------------------------| U | +;;; | T | | | | | | T | +;;; | H | 1 | 2 | 3 | 4 | 5 | H | +;;; | | | | | | | | +;;; \--------------------------------/ +;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; +;;; Roles. +;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(role north) +(role south) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; +;;; Base propositions. +;;; +;;; - Number of seeds in each pit (or scoring pit). +;;; - Number of seeds in each hand. +;;; - Which pit (or scoring pit) we're at. (Only valid when sowing seeds.) +;;; - Which role's turn is it. +;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(<= (base (pit ?p ?n)) + (anypit ?p) + (number ?n)) + +(<= (base (hand ?r ?n)) + (role ?r) + (number ?n)) + +(<= (base (at ?p)) + (anypit ?p)) + +(<= (base (control ?r)) + (role ?r)) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; +;;; Input propositions. +;;; +;;; - No-op (Primarily when it isn't a role's turn). +;;; - Pick up all the seeds from a pit into hand. +;;; - Put a seed into the next pit (including scoring pits). +;;; - Clear a pit into the scoring pot (at the end of the game). +;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(<= (input ?r noop) + (role ?r)) + +(<= (input ?r (pick ?p)) + (role ?r) + (normalpit ?p)) + +(<= (input ?r (put ?p)) + (role ?r) + (anypit ?p)) + +(<= (input ?r (clear ?p)) + (role ?r) + (normalpit ?p)) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; +;;; Initially true propositions. +;;; +;;; - 3 seeds in each pit. +;;; - No seeds in the scoring pits. +;;; - No seeds in hand. +;;; - North to play. +;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(<= (init (pit ?p s3)) + (normalpit ?p)) + +(<= (init (pit ?p s0)) + (scoringpit ?r ?p)) + +(<= (init (hand ?r s0)) + (role ?r)) + +(init (control north)) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; +;;; Legal moves. +;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(<= (legal ?r noop) + (role ?r) + (true (control ?r2)) + (distinct ?r ?r2)) + +(<= (legal ?r noop) + (true (control ?r)) + (allempty ?r) + (true (hand ?r s0))) + +(<= (legal ?r (clear ?p)) + (true (control ?r)) + (owner ?r ?p) + (not (true (pit ?p s0))) + (role ?r2) + (distinct ?r ?r2) + (allempty ?r2)) + +(<= (legal ?r (pick ?p)) + (true (control ?r)) + (true (hand ?r s0)) + (owner ?r ?p) + (not (true (pit ?p s0))) + (role ?r2) + (distinct ?r ?r2) + (not (allempty ?r2))) + +(<= (legal ?r (put ?p)) + (true (control ?r)) + (true (at ?p)) + (true (hand ?r ?n)) + (distinct ?n s0)) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; +;;; Game end. +;;; +;;; - Game ends when all the (non-scoring) pits are empty (for both roles). +;;; - Score is mapped from the number of seeds in the scoring pits. +;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(<= terminal + (allempty north) + (allempty south)) + +(<= (goal ?r ?score) + (scoringpit ?r ?p) + (true (pit ?p ?n)) + (map_to_score ?n ?score)) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; +;;; Next state. +;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(<= (next (control ?r)) + (does ?r (pick ?p))) + +(<= (next (control ?r)) + (does ?r (clear ?p))) + +(<= (next (control ?r)) + (does ?r (put ?p)) + (true (hand ?r ?n)) + (distinct ?n s1)) + +(<= (next (control ?r)) + (does ?r (put ?p)) + (true (hand ?r s1)) + (scoringpit ?r ?p)) + +(<= (next (control ?r2)) + (does ?r (put ?p)) + (true (hand ?r s1)) + (not (scoringpit ?r ?p)) + (role ?r2) + (distinct ?r2 ?r)) + +(<= (next (control ?r2)) + (true (control ?r)) + (does ?r noop) + (role ?r2) + (distinct ?r2 ?r)) + + +(<= (next (hand ?r ?n)) + (does ?r (pick ?p)) + (true (pit ?p ?n))) + +(<= (next (hand ?r ?n)) + (does ?r (put ?p)) + (true (hand ?r ?n1)) + (succ ?n ?n1)) + +(<= (next (hand ?r ?n)) + (does ?r noop) + (true (hand ?r ?n))) + +(<= (next (hand ?r ?n)) + (does ?r (clear ?p)) + (true (hand ?r ?n))) + + +(<= (next (at ?p2)) + (does ?r (pick ?p)) + (nextpit ?r ?p ?p2)) + +(<= (next (at ?p2)) + (does ?r (put ?p)) + (true (hand ?r ?n)) + (distinct ?n s1) + (nextpit ?r ?p ?p2)) + + +(<= (next (pit ?p s0)) + (does ?r (clear ?p))) + +(<= (next (pit ?p ?n2)) + (does ?r (clear ?p2)) + (scoringpit ?r ?p) + (true (pit ?p ?n)) + (true (pit ?p2 ?n1)) + (plus ?n ?n1 ?n2)) + +(<= (next (pit ?p ?n)) + (true (pit ?p ?n)) + (does ?r (clear ?p2)) + (distinct ?p ?p2) + (not (scoringpit ?r ?p))) + +(<= (next (pit ?p s0)) + (does ?r (pick ?p))) +(<= (next (pit ?p ?n)) + (does ?r (pick ?p2)) + (true (pit ?p ?n)) + (distinct ?p ?p2)) + +(<= (next (pit ?p ?n2)) + (does ?r (put ?p)) + (not (true (hand ?r s1))) + (true (pit ?p ?n)) + (succ ?n ?n2)) + +(<= (next (pit ?p ?n)) + (does ?r (put ?p2)) + (true (pit ?p ?n)) + (distinct ?p ?p2) + (not (true (hand ?r s1)))) + +(<= (next (pit ?p ?n2)) + (does ?r (put ?p)) + (true (hand ?r s1)) + (not (emptyonlastput ?r ?p ?p)) + (true (pit ?p ?n)) + (succ ?n ?n2)) + +(<= (next (pit ?p ?n)) + (does ?r (put ?p2)) + (true (pit ?p ?n)) + (distinct ?p ?p2) + (true (hand ?r s1)) + (not (emptyonlastput ?r ?p2 ?p2))) + +(<= (next (pit ?p s0)) + (does ?r (put ?p2)) + (true (hand ?r s1)) + (emptyonlastput ?r ?p2 ?p)) + +(<= (next (pit ?p ?n2)) + (does ?r (put ?p2)) + (true (hand ?r s1)) + (scoringpit ?r ?p) + (emptyonlastput ?r ?p2 ?p2) + (opposite ?p2 ?p3) + (true (pit ?p ?n)) + (true (pit ?p3 ?np3)) + (plus ?n ?np3 ?n1) + (succ ?n1 ?n2)) + +(<= (next (pit ?p ?n)) + (does ?r (put ?p2)) + (true (hand ?r s1)) + (true (pit ?p ?n)) + (distinct ?p ?p2) + (not (scoringpit ?r ?p)) + (not (opposite ?p ?p2)) + (emptyonlastput ?r ?p2 ?p2)) + +(<= (next (pit ?p ?n)) + (does north noop) + (does south noop) + (true (pit ?p ?n))) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; +;;; Views. +;;; +;;; - Emptiness checking. +;;; - The 'opposite' relation is symmetric. +;;; - Addition (recursive). +;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(<= (allempty north) + (true (pit p6 s0)) + (true (pit p7 s0)) + (true (pit p8 s0)) + (true (pit p9 s0)) + (true (pit p10 s0))) + +(<= (allempty south) + (true (pit p1 s0)) + (true (pit p2 s0)) + (true (pit p3 s0)) + (true (pit p4 s0)) + (true (pit p5 s0))) + +(<= (some_not_empty ?r) + (owner ?r ?p) + (true (pit ?p ?n)) + (distinct ?n s0)) + +(<= (emptyonlastput ?r ?p ?p) + (owner ?r ?p) + (true (pit ?p s0))) + +(<= (emptyonlastput ?r ?p ?p2) + (opposite ?p ?p2) + (owner ?r ?p) + (true (pit ?p s0))) + +(<= (opposite ?p1 ?p2) + (basicopposite ?p1 ?p2)) + +(<= (opposite ?p1 ?p2) + (basicopposite ?p2 ?p1)) + +(<= (plus ?x s0 ?x) + (number ?x)) + +(<= (plus ?x ?y ?z) + (succ ?y2 ?y) + (succ ?x ?x2) + (plus ?x2 ?y2 ?z)) + +(<= (anypit ?p) + (normalpit ?p)) + +(<= (anypit ?p) + (scoringpit ?r ?p)) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; +;;; Data. +;;; +;;; - Names of the pits. +;;; - Pit owners (regular and scoring pits). +;;; - Pit layout. +;;; - Which pits are opposite each other (for captures). +;;; - Sequence of pits when sowing seeds (different for each role). +;;; - Score map. (Strong incentive to win. Thereafter, small incentive to +;;; finish with more seeds.) +;;; - Numbers (including successors). +;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(normalpit p1) +(normalpit p2) +(normalpit p3) +(normalpit p4) +(normalpit p5) +(normalpit p6) +(normalpit p7) +(normalpit p8) +(normalpit p9) +(normalpit p10) + +(scoringpit north pwinnorth) +(scoringpit south pwinsouth) + +(owner north p6) +(owner north p7) +(owner north p8) +(owner north p9) +(owner north p10) +(owner south p1) +(owner south p2) +(owner south p3) +(owner south p4) +(owner south p5) + +(basicopposite p1 p10) +(basicopposite p2 p9) +(basicopposite p3 p8) +(basicopposite p4 p7) +(basicopposite p5 p6) + +(nextpit south p1 p2) +(nextpit south p2 p3) +(nextpit south p3 p4) +(nextpit south p4 p5) +(nextpit south p5 pwinsouth) +(nextpit south pwinsouth p6) +(nextpit south p6 p7) +(nextpit south p7 p8) +(nextpit south p8 p9) +(nextpit south p9 p10) +(nextpit south p10 p1) + +(nextpit north p1 p2) +(nextpit north p2 p3) +(nextpit north p3 p4) +(nextpit north p4 p5) +(nextpit north p5 p6) +(nextpit north p6 p7) +(nextpit north p7 p8) +(nextpit north p8 p9) +(nextpit north p9 p10) +(nextpit north p10 pwinnorth) +(nextpit north pwinnorth p1) + +(map_to_score s0 0) +(map_to_score s1 0) +(map_to_score s2 0) +(map_to_score s3 0) +(map_to_score s4 0) +(map_to_score s5 0) +(map_to_score s6 0) +(map_to_score s7 0) +(map_to_score s8 0) +(map_to_score s9 0) +(map_to_score s10 0) +(map_to_score s11 0) +(map_to_score s12 0) +(map_to_score s13 0) +(map_to_score s14 0) +(map_to_score s15 50) +(map_to_score s16 86) +(map_to_score s17 87) +(map_to_score s18 88) +(map_to_score s19 89) +(map_to_score s20 90) +(map_to_score s21 91) +(map_to_score s22 92) +(map_to_score s23 93) +(map_to_score s24 94) +(map_to_score s25 95) +(map_to_score s26 96) +(map_to_score s27 97) +(map_to_score s28 98) +(map_to_score s29 99) +(map_to_score s30 100) + +(number s0) +(number s1) +(number s2) +(number s3) +(number s4) +(number s5) +(number s6) +(number s7) +(number s8) +(number s9) +(number s10) +(number s11) +(number s12) +(number s13) +(number s14) +(number s15) +(number s16) +(number s17) +(number s18) +(number s19) +(number s20) +(number s21) +(number s22) +(number s23) +(number s24) +(number s25) +(number s26) +(number s27) +(number s28) +(number s29) +(number s30) + +(succ s0 s1) +(succ s1 s2) +(succ s2 s3) +(succ s3 s4) +(succ s4 s5) +(succ s5 s6) +(succ s6 s7) +(succ s7 s8) +(succ s8 s9) +(succ s9 s10) +(succ s10 s11) +(succ s11 s12) +(succ s12 s13) +(succ s13 s14) +(succ s14 s15) +(succ s15 s16) +(succ s16 s17) +(succ s17 s18) +(succ s18 s19) +(succ s19 s20) +(succ s20 s21) +(succ s21 s22) +(succ s22 s23) +(succ s23 s24) +(succ s24 s25) +(succ s25 s26) +(succ s26 s27) +(succ s27 s28) +(succ s28 s29) +(succ s29 s30) + diff --git a/war/root/games/kalaha5x2x3/kalah.txt b/war/root/games/kalaha5x2x3/kalah.txt new file mode 100644 index 0000000..5158ffc --- /dev/null +++ b/war/root/games/kalaha5x2x3/kalah.txt @@ -0,0 +1 @@ +Kalah (a.k.a. Kalaha or Mancala) is possibly the oldest board game in the world, dating back to the 6th century. This version is played with 2 rows of 5 pits, each initially containing 3 seeds. diff --git a/war/root/games/kalaha5x2x3/kalah.xsl b/war/root/games/kalaha5x2x3/kalah.xsl new file mode 100644 index 0000000..9138fd4 --- /dev/null +++ b/war/root/games/kalaha5x2x3/kalah.xsl @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + It is 's turn. They have seeds in hand. + + + + diff --git a/war/root/games/kalaha6x2x4/METADATA b/war/root/games/kalaha6x2x4/METADATA new file mode 100644 index 0000000..576e659 --- /dev/null +++ b/war/root/games/kalaha6x2x4/METADATA @@ -0,0 +1,7 @@ +{ + "gameName": "Kalah 6x2x4", + "rulesheet": "kalah.kif", + "description": "kalah.txt", + "stylesheet": "kalah.xsl", + "curator": "arr" +} diff --git a/war/root/games/kalaha6x2x4/kalah.kif b/war/root/games/kalaha6x2x4/kalah.kif new file mode 100644 index 0000000..e4eb7dd --- /dev/null +++ b/war/root/games/kalaha6x2x4/kalah.kif @@ -0,0 +1,589 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; +;;; Kalah (a.k.a. Kalaha and Mancala). +;;; +;;; 6 pits (x2), 4 seeds. +;;; +;;; /-------------------------------------\ +;;; | | | | | | | | | +;;; | N | 12 | 11 | 10 | 9 | 8 | 7 | S | +;;; | O | | | | | | | O | +;;; | R |-----------------------------| U | +;;; | T | | | | | | | T | +;;; | H | 1 | 2 | 3 | 4 | 5 | 6 | H | +;;; | | | | | | | | | +;;; \-------------------------------------/ +;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; +;;; Roles. +;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(role north) +(role south) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; +;;; Base propositions. +;;; +;;; - Number of seeds in each pit (or scoring pit). +;;; - Number of seeds in each hand. +;;; - Which pit (or scoring pit) we're at. (Only valid when sowing seeds.) +;;; - Which role's turn is it. +;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(<= (base (pit ?p ?n)) + (anypit ?p) + (number ?n)) + +(<= (base (hand ?r ?n)) + (role ?r) + (number ?n)) + +(<= (base (at ?p)) + (anypit ?p)) + +(<= (base (control ?r)) + (role ?r)) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; +;;; Input propositions. +;;; +;;; - No-op (Primarily when it isn't a role's turn). +;;; - Pick up all the seeds from a pit into hand. +;;; - Put a seed into the next pit (including scoring pits). +;;; - Clear a pit into the scoring pot (at the end of the game). +;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(<= (input ?r noop) + (role ?r)) + +(<= (input ?r (pick ?p)) + (role ?r) + (normalpit ?p)) + +(<= (input ?r (put ?p)) + (role ?r) + (anypit ?p)) + +(<= (input ?r (clear ?p)) + (role ?r) + (normalpit ?p)) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; +;;; Initially true propositions. +;;; +;;; - 4 seeds in each pit. +;;; - No seeds in the scoring pits. +;;; - No seeds in hand. +;;; - North to play. +;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(<= (init (pit ?p s4)) + (normalpit ?p)) + +(<= (init (pit ?p s0)) + (scoringpit ?r ?p)) + +(<= (init (hand ?r s0)) + (role ?r)) + +(init (control north)) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; +;;; Legal moves. +;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(<= (legal ?r noop) + (role ?r) + (true (control ?r2)) + (distinct ?r ?r2)) + +(<= (legal ?r noop) + (true (control ?r)) + (allempty ?r) + (true (hand ?r s0))) + +(<= (legal ?r (clear ?p)) + (true (control ?r)) + (owner ?r ?p) + (not (true (pit ?p s0))) + (role ?r2) + (distinct ?r ?r2) + (allempty ?r2)) + +(<= (legal ?r (pick ?p)) + (true (control ?r)) + (true (hand ?r s0)) + (owner ?r ?p) + (not (true (pit ?p s0))) + (role ?r2) + (distinct ?r ?r2) + (not (allempty ?r2))) + +(<= (legal ?r (put ?p)) + (true (control ?r)) + (true (at ?p)) + (true (hand ?r ?n)) + (distinct ?n s0)) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; +;;; Game end. +;;; +;;; - Game ends when all the (non-scoring) pits are empty (for both roles). +;;; - Score is mapped from the number of seeds in the scoring pits. +;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(<= terminal + (allempty north) + (allempty south)) + +(<= (goal ?r ?score) + (scoringpit ?r ?p) + (true (pit ?p ?n)) + (map_to_score ?n ?score)) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; +;;; Next state. +;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(<= (next (control ?r)) + (does ?r (pick ?p))) + +(<= (next (control ?r)) + (does ?r (clear ?p))) + +(<= (next (control ?r)) + (does ?r (put ?p)) + (true (hand ?r ?n)) + (distinct ?n s1)) + +(<= (next (control ?r)) + (does ?r (put ?p)) + (true (hand ?r s1)) + (scoringpit ?r ?p)) + +(<= (next (control ?r2)) + (does ?r (put ?p)) + (true (hand ?r s1)) + (not (scoringpit ?r ?p)) + (role ?r2) + (distinct ?r2 ?r)) + +(<= (next (control ?r2)) + (true (control ?r)) + (does ?r noop) + (role ?r2) + (distinct ?r2 ?r)) + + +(<= (next (hand ?r ?n)) + (does ?r (pick ?p)) + (true (pit ?p ?n))) + +(<= (next (hand ?r ?n)) + (does ?r (put ?p)) + (true (hand ?r ?n1)) + (succ ?n ?n1)) + +(<= (next (hand ?r ?n)) + (does ?r noop) + (true (hand ?r ?n))) + +(<= (next (hand ?r ?n)) + (does ?r (clear ?p)) + (true (hand ?r ?n))) + + +(<= (next (at ?p2)) + (does ?r (pick ?p)) + (nextpit ?r ?p ?p2)) + +(<= (next (at ?p2)) + (does ?r (put ?p)) + (true (hand ?r ?n)) + (distinct ?n s1) + (nextpit ?r ?p ?p2)) + + +(<= (next (pit ?p s0)) + (does ?r (clear ?p))) + +(<= (next (pit ?p ?n2)) + (does ?r (clear ?p2)) + (scoringpit ?r ?p) + (true (pit ?p ?n)) + (true (pit ?p2 ?n1)) + (plus ?n ?n1 ?n2)) + +(<= (next (pit ?p ?n)) + (true (pit ?p ?n)) + (does ?r (clear ?p2)) + (distinct ?p ?p2) + (not (scoringpit ?r ?p))) + +(<= (next (pit ?p s0)) + (does ?r (pick ?p))) +(<= (next (pit ?p ?n)) + (does ?r (pick ?p2)) + (true (pit ?p ?n)) + (distinct ?p ?p2)) + +(<= (next (pit ?p ?n2)) + (does ?r (put ?p)) + (not (true (hand ?r s1))) + (true (pit ?p ?n)) + (succ ?n ?n2)) + +(<= (next (pit ?p ?n)) + (does ?r (put ?p2)) + (true (pit ?p ?n)) + (distinct ?p ?p2) + (not (true (hand ?r s1)))) + +(<= (next (pit ?p ?n2)) + (does ?r (put ?p)) + (true (hand ?r s1)) + (not (emptyonlastput ?r ?p ?p)) + (true (pit ?p ?n)) + (succ ?n ?n2)) + +(<= (next (pit ?p ?n)) + (does ?r (put ?p2)) + (true (pit ?p ?n)) + (distinct ?p ?p2) + (true (hand ?r s1)) + (not (emptyonlastput ?r ?p2 ?p2))) + +(<= (next (pit ?p s0)) + (does ?r (put ?p2)) + (true (hand ?r s1)) + (emptyonlastput ?r ?p2 ?p)) + +(<= (next (pit ?p ?n2)) + (does ?r (put ?p2)) + (true (hand ?r s1)) + (scoringpit ?r ?p) + (emptyonlastput ?r ?p2 ?p2) + (opposite ?p2 ?p3) + (true (pit ?p ?n)) + (true (pit ?p3 ?np3)) + (plus ?n ?np3 ?n1) + (succ ?n1 ?n2)) + +(<= (next (pit ?p ?n)) + (does ?r (put ?p2)) + (true (hand ?r s1)) + (true (pit ?p ?n)) + (distinct ?p ?p2) + (not (scoringpit ?r ?p)) + (not (opposite ?p ?p2)) + (emptyonlastput ?r ?p2 ?p2)) + +(<= (next (pit ?p ?n)) + (does north noop) + (does south noop) + (true (pit ?p ?n))) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; +;;; Views. +;;; +;;; - Emptiness checking. +;;; - The 'opposite' relation is symmetric. +;;; - Addition (recursive). +;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(<= (allempty north) + (true (pit p7 s0)) + (true (pit p8 s0)) + (true (pit p9 s0)) + (true (pit p10 s0)) + (true (pit p11 s0)) + (true (pit p12 s0))) + +(<= (allempty south) + (true (pit p1 s0)) + (true (pit p2 s0)) + (true (pit p3 s0)) + (true (pit p4 s0)) + (true (pit p5 s0)) + (true (pit p6 s0))) + +(<= (some_not_empty ?r) + (owner ?r ?p) + (true (pit ?p ?n)) + (distinct ?n s0)) + +(<= (emptyonlastput ?r ?p ?p) + (owner ?r ?p) + (true (pit ?p s0))) + +(<= (emptyonlastput ?r ?p ?p2) + (opposite ?p ?p2) + (owner ?r ?p) + (true (pit ?p s0))) + +(<= (opposite ?p1 ?p2) + (basicopposite ?p1 ?p2)) + +(<= (opposite ?p1 ?p2) + (basicopposite ?p2 ?p1)) + +(<= (plus ?x s0 ?x) + (number ?x)) + +(<= (plus ?x ?y ?z) + (succ ?y2 ?y) + (succ ?x ?x2) + (plus ?x2 ?y2 ?z)) + +(<= (anypit ?p) + (normalpit ?p)) + +(<= (anypit ?p) + (scoringpit ?r ?p)) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; +;;; Data. +;;; +;;; - Names of the pits. +;;; - Pit owners (regular and scoring pits). +;;; - Pit layout. +;;; - Which pits are opposite each other (for captures). +;;; - Sequence of pits when sowing seeds (different for each role). +;;; - Score map. (Strong incentive to win. Thereafter, small incentive to +;;; finish with more seeds.) +;;; - Numbers (including successors). +;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(normalpit p1) +(normalpit p2) +(normalpit p3) +(normalpit p4) +(normalpit p5) +(normalpit p6) +(normalpit p7) +(normalpit p8) +(normalpit p9) +(normalpit p10) +(normalpit p11) +(normalpit p12) + +(scoringpit north pwinnorth) +(scoringpit south pwinsouth) + +(owner north p7) +(owner north p8) +(owner north p9) +(owner north p10) +(owner north p11) +(owner north p12) +(owner south p1) +(owner south p2) +(owner south p3) +(owner south p4) +(owner south p5) +(owner south p6) + +(basicopposite p1 p12) +(basicopposite p2 p11) +(basicopposite p3 p10) +(basicopposite p4 p9) +(basicopposite p5 p8) +(basicopposite p6 p7) + +(nextpit south p1 p2) +(nextpit south p2 p3) +(nextpit south p3 p4) +(nextpit south p4 p5) +(nextpit south p5 p6) +(nextpit south p6 pwinsouth) +(nextpit south pwinsouth p7) +(nextpit south p7 p8) +(nextpit south p8 p9) +(nextpit south p9 p10) +(nextpit south p10 p11) +(nextpit south p11 p12) +(nextpit south p12 p1) + +(nextpit north p1 p2) +(nextpit north p2 p3) +(nextpit north p3 p4) +(nextpit north p4 p5) +(nextpit north p5 p6) +(nextpit north p6 p7) +(nextpit north p7 p8) +(nextpit north p8 p9) +(nextpit north p9 p10) +(nextpit north p10 p11) +(nextpit north p11 p12) +(nextpit north p12 pwinnorth) +(nextpit north pwinnorth p1) + +(map_to_score s0 0) +(map_to_score s1 0) +(map_to_score s2 0) +(map_to_score s3 0) +(map_to_score s4 0) +(map_to_score s5 0) +(map_to_score s6 0) +(map_to_score s7 0) +(map_to_score s8 0) +(map_to_score s9 0) +(map_to_score s10 0) +(map_to_score s11 0) +(map_to_score s12 0) +(map_to_score s13 0) +(map_to_score s14 0) +(map_to_score s15 0) +(map_to_score s16 0) +(map_to_score s17 0) +(map_to_score s18 0) +(map_to_score s19 0) +(map_to_score s20 0) +(map_to_score s21 0) +(map_to_score s22 0) +(map_to_score s23 0) +(map_to_score s24 50) +(map_to_score s25 88) +(map_to_score s26 89) +(map_to_score s27 89) +(map_to_score s28 90) +(map_to_score s29 90) +(map_to_score s30 91) +(map_to_score s31 91) +(map_to_score s32 92) +(map_to_score s33 92) +(map_to_score s34 93) +(map_to_score s35 93) +(map_to_score s36 94) +(map_to_score s37 94) +(map_to_score s38 95) +(map_to_score s39 95) +(map_to_score s40 96) +(map_to_score s41 96) +(map_to_score s42 97) +(map_to_score s43 97) +(map_to_score s44 98) +(map_to_score s45 98) +(map_to_score s46 99) +(map_to_score s47 99) +(map_to_score s48 100) + +(number s0) +(number s1) +(number s2) +(number s3) +(number s4) +(number s5) +(number s6) +(number s7) +(number s8) +(number s9) +(number s10) +(number s11) +(number s12) +(number s13) +(number s14) +(number s15) +(number s16) +(number s17) +(number s18) +(number s19) +(number s20) +(number s21) +(number s22) +(number s23) +(number s24) +(number s25) +(number s26) +(number s27) +(number s28) +(number s29) +(number s30) +(number s31) +(number s32) +(number s33) +(number s34) +(number s35) +(number s36) +(number s37) +(number s38) +(number s39) +(number s40) +(number s41) +(number s42) +(number s43) +(number s44) +(number s45) +(number s46) +(number s47) +(number s48) + +(succ s0 s1) +(succ s1 s2) +(succ s2 s3) +(succ s3 s4) +(succ s4 s5) +(succ s5 s6) +(succ s6 s7) +(succ s7 s8) +(succ s8 s9) +(succ s9 s10) +(succ s10 s11) +(succ s11 s12) +(succ s12 s13) +(succ s13 s14) +(succ s14 s15) +(succ s15 s16) +(succ s16 s17) +(succ s17 s18) +(succ s18 s19) +(succ s19 s20) +(succ s20 s21) +(succ s21 s22) +(succ s22 s23) +(succ s23 s24) +(succ s24 s25) +(succ s25 s26) +(succ s26 s27) +(succ s27 s28) +(succ s28 s29) +(succ s29 s30) +(succ s30 s31) +(succ s31 s32) +(succ s32 s33) +(succ s33 s34) +(succ s34 s35) +(succ s35 s36) +(succ s36 s37) +(succ s37 s38) +(succ s38 s39) +(succ s39 s40) +(succ s40 s41) +(succ s41 s42) +(succ s42 s43) +(succ s43 s44) +(succ s44 s45) +(succ s45 s46) +(succ s46 s47) +(succ s47 s48) + diff --git a/war/root/games/kalaha6x2x4/kalah.txt b/war/root/games/kalaha6x2x4/kalah.txt new file mode 100644 index 0000000..4d59797 --- /dev/null +++ b/war/root/games/kalaha6x2x4/kalah.txt @@ -0,0 +1 @@ +Kalah (a.k.a. Kalaha or Mancala) is possibly the oldest board game in the world, dating back to the 6th century. This version is played with 2 rows of 6 pits, each initially containing 4 seeds. diff --git a/war/root/games/kalaha6x2x4/kalah.xsl b/war/root/games/kalaha6x2x4/kalah.xsl new file mode 100644 index 0000000..d42c4cc --- /dev/null +++ b/war/root/games/kalaha6x2x4/kalah.xsl @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + It is 's turn. They have seeds in hand. + + + + diff --git a/war/root/games/majorities/METADATA b/war/root/games/majorities/METADATA new file mode 100644 index 0000000..9995421 --- /dev/null +++ b/war/root/games/majorities/METADATA @@ -0,0 +1,7 @@ +{ + "gameName": "Majorities", + "rulesheet": "majorities.kif", + "description": "majorities.txt", + "stylesheet": "majorities.xsl", + "curator": "arr" +} diff --git a/war/root/games/majorities/majorities.kif b/war/root/games/majorities/majorities.kif new file mode 100644 index 0000000..ab5f699 --- /dev/null +++ b/war/root/games/majorities/majorities.kif @@ -0,0 +1,447 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; Majorities +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; +;;; Components +;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + (role red) + (role blue) + + + (<= (base (cell ?m ?n ?r)) + (row ?m) + (col ?n) + (role ?r)) + + (<= (base (control ?r)) + (role ?r)) + + (<= (base (lastcontrol ?r)) + (role ?r)) + + (<= (base (line_count ?id ?r ?count)) + (line_id ?id) + (role ?r) + (num ?count)) + + (<= (base (num_letter_lines ?r ?count)) + (role ?r) + (num ?count)) + + (<= (base (num_number_lines ?r ?count)) + (role ?r) + (num ?count)) + + (<= (base (num_vertical_lines ?r ?count)) + (role ?r) + (num ?count)) + + + (<= (input ?r (place ?m ?n)) + (role ?r) + (row ?m) + (col ?n)) + + (<= (input ?r noop) + (role ?r)) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; +;;; Initial state +;;; +;;; - Red plays first, but only gets to place one stone. +;;; - Nobody has any stones in any lines. +;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + (init (control red)) + (init (lastcontrol red)) + + (<= (init (line_count ?id ?r 0)) + (line_id ?id) + (role ?r)) + + (<= (init (num_letter_lines ?r 0)) + (role ?r)) + + (<= (init (num_number_lines ?r 0)) + (role ?r)) + + (<= (init (num_vertical_lines ?r 0)) + (role ?r)) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; +;;; Legal moves +;;; +;;; - On a player's turn, a stone can be placed on any unoccupied cell (that +;;; isn't out-out-bounds). +;;; - The other player must no-op. +;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + (<= (legal ?r (place ?m ?n)) + (true (control ?r)) + (row ?m) + (col ?n) + (not (true (cell ?m ?n red))) + (not (true (cell ?m ?n blue))) + (not (oob ?m ?n))) + + (<= (legal red noop) + (true (control blue))) + + (<= (legal blue noop) + (true (control red))) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; +;;; Next +;;; +;;; - A cell has a player's stone if they place one there. +;;; - Once placed, stones are never [re-]moved. +;;; +;;; - After the first turn, players get two turns in a row. +;;; +;;; - A player has 1 more stone on each line just played on. (We also keep a +;;; complete history. So when a player has 2 stones on a line, the props for +;;; 0 and 1 stones will also be set.) +;;; +;;; - If a player has just gained a line this turn, increment the number of +;;; lines. (Again, we keep a history.) +;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + (<= (next (cell ?m ?n ?r)) + (does ?r (place ?m ?n))) + + (<= (next (cell ?m ?n ?r)) + (true (cell ?m ?n ?r))) + + + (<= (next (lastcontrol ?r)) + (true (control ?r))) + + (<= (next (control red)) + (true (lastcontrol blue))) + + (<= (next (control blue)) + (true (lastcontrol red))) + + + (<= (next (line_count ?id ?r ?count)) + (true (line_count ?id ?r ?count))) + + (<= (next (line_count ?id ?r ?count)) + (true (line_count ?id ?r ?prev)) + (succ ?prev ?count) + (does ?r (place ?m ?n)) + (in_line ?id ?m ?n)) + + + (<= (next (num_letter_lines ?r ?count)) + (true (num_letter_lines ?r ?count))) + + (<= (next (num_letter_lines ?r ?count)) + (true (num_letter_lines ?r ?prev)) + (succ ?prev ?count) + (does ?r (place ?m ?n)) + (in_line ?id ?m ?n) + (row ?id) + (one_short_of_line_majority ?id ?r)) + + (<= (next (num_number_lines ?r ?count)) + (true (num_number_lines ?r ?count))) + + (<= (next (num_number_lines ?r ?count)) + (true (num_number_lines ?r ?prev)) + (succ ?prev ?count) + (does ?r (place ?m ?n)) + (in_line ?id ?m ?n) + (col ?id) + (one_short_of_line_majority ?id ?r)) + + (<= (next (num_vertical_lines ?r ?count)) + (true (num_vertical_lines ?r ?count))) + + (<= (next (num_vertical_lines ?r ?count)) + (true (num_vertical_lines ?r ?prev)) + (succ ?prev ?count) + (does ?r (place ?m ?n)) + (in_line ?id ?m ?n) + (ver ?id) + (one_short_of_line_majority ?id ?r)) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; +;;; Goals +;;; +;;; - A player scores 100 if they have (at least) 2 of the 3 directions. +;;; - Otherwise they score 0. +;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + (<= (goal ?r 100) + (role ?r) + (majority_numbers ?r) + (majority_letters ?r)) + + (<= (goal ?r 100) + (role ?r) + (majority_numbers ?r) + (majority_verticals ?r)) + + (<= (goal ?r 100) + (role ?r) + (majority_letters ?r) + (majority_verticals ?r)) + + (<= (goal ?r 0) + (role ?r) + (not (goal ?r 100))) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; +;;; Terminality +;;; +;;; The game is terminal when one of the players has won. (When the board is +;;; full, one of the players has always won, so there is no need for a step +;;; count or 'open' relation.) +;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + (<= terminal + (role ?r) + (goal ?r 100)) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; +;;; Views +;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + (<= (line_id ?id) + (row ?id)) + + (<= (line_id ?id) + (col ?id)) + + (<= (line_id ?id) + (ver ?id)) + + (<= (in_line ?m ?m ?n) + (row ?m) + (col ?n)) + + (<= (in_line ?n ?m ?n) + (row ?m) + (col ?n)) + + (<= (in_line ?id ?m ?n) + (in_ver ?id ?m ?n)) + + (<= (has_line_majority ?id ?r) + (true (line_count ?id ?r ?count)) + (maj ?id ?count)) + + (<= (one_short_of_line_majority ?id ?r) + (maj ?id ?maj_req) + (succ ?one_short ?maj_req) + (true (line_count ?id ?r ?one_short)) + (not (true (line_count ?id ?r ?maj_req)))) + + (<= (majority_letters ?r) + (true (num_letter_lines ?r 5))) + + (<= (majority_numbers ?r) + (true (num_number_lines ?r 5))) + + (<= (majority_verticals ?r) + (true (num_vertical_lines ?r 5))) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; +;;; Data +;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + (row a) + (row b) + (row c) + (row d) + (row e) + (row f) + (row g) + (row h) + (row i) + + (col 1) + (col 2) + (col 3) + (col 4) + (col 5) + (col 6) + (col 7) + (col 8) + (col 9) + + (ver a5) + (ver a6) + (ver a7) + (ver a8) + (ver a9) + (ver b9) + (ver c9) + (ver d9) + (ver e9) + + (in_ver a5 a 5) + (in_ver a5 b 4) + (in_ver a5 c 3) + (in_ver a5 d 2) + (in_ver a5 e 1) + + (in_ver a6 a 6) + (in_ver a6 b 5) + (in_ver a6 c 4) + (in_ver a6 d 3) + (in_ver a6 e 2) + (in_ver a6 f 1) + + (in_ver a7 a 7) + (in_ver a7 b 6) + (in_ver a7 c 5) + (in_ver a7 d 4) + (in_ver a7 e 3) + (in_ver a7 f 2) + (in_ver a7 g 1) + + (in_ver a8 a 8) + (in_ver a8 b 7) + (in_ver a8 c 6) + (in_ver a8 d 5) + (in_ver a8 e 4) + (in_ver a8 f 3) + (in_ver a8 g 2) + (in_ver a8 h 1) + + (in_ver a9 a 9) + (in_ver a9 b 8) + (in_ver a9 c 7) + (in_ver a9 d 6) + (in_ver a9 e 5) + (in_ver a9 f 4) + (in_ver a9 g 3) + (in_ver a9 h 2) + (in_ver a9 i 1) + + (in_ver b9 b 9) + (in_ver b9 c 8) + (in_ver b9 d 7) + (in_ver b9 e 6) + (in_ver b9 f 5) + (in_ver b9 g 4) + (in_ver b9 h 3) + (in_ver b9 i 2) + + (in_ver c9 c 9) + (in_ver c9 d 8) + (in_ver c9 e 7) + (in_ver c9 f 6) + (in_ver c9 g 5) + (in_ver c9 h 4) + (in_ver c9 i 3) + + (in_ver d9 d 9) + (in_ver d9 e 8) + (in_ver d9 f 7) + (in_ver d9 g 6) + (in_ver d9 h 5) + (in_ver d9 i 4) + + (in_ver e9 e 9) + (in_ver e9 f 8) + (in_ver e9 g 7) + (in_ver e9 h 6) + (in_ver e9 i 5) + + (oob a 1) + (oob a 2) + (oob a 3) + (oob a 4) + (oob b 1) + (oob b 2) + (oob b 3) + (oob c 1) + (oob c 2) + (oob d 1) + (oob f 9) + (oob g 8) + (oob g 9) + (oob h 7) + (oob h 8) + (oob h 9) + (oob i 6) + (oob i 7) + (oob i 8) + (oob i 9) + + (oob b 8) + (oob d 6) + (oob e 2) + (oob e 4) + (oob f 5) + (oob h 5) + + (maj a 3) + (maj b 3) + (maj c 4) + (maj d 4) + (maj e 4) + (maj f 4) + (maj g 4) + (maj h 3) + (maj i 3) + + (maj 1 3) + (maj 2 3) + (maj 3 4) + (maj 4 4) + (maj 5 4) + (maj 6 4) + (maj 7 4) + (maj 8 3) + (maj 9 3) + + (maj a5 3) + (maj a6 3) + (maj a7 4) + (maj a8 4) + (maj a9 4) + (maj b9 4) + (maj c9 4) + (maj d9 3) + (maj e9 3) + + (num 0) + (num 1) + (num 2) + (num 3) + (num 4) + (num 5) + (num 6) + (num 7) + + (succ 0 1) + (succ 1 2) + (succ 2 3) + (succ 3 4) + (succ 4 5) + (succ 5 6) + (succ 6 7) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/war/root/games/majorities/majorities.txt b/war/root/games/majorities/majorities.txt new file mode 100644 index 0000000..9492666 --- /dev/null +++ b/war/root/games/majorities/majorities.txt @@ -0,0 +1 @@ +The aim of the game is to control a majority of the (three) directions. To control a direction, a player must control a majority of lines in that direction. To control a line, a player must have stones on a majority of the hexes. diff --git a/war/root/games/majorities/majorities.xsl b/war/root/games/majorities/majorities.xsl new file mode 100644 index 0000000..8915530 --- /dev/null +++ b/war/root/games/majorities/majorities.xsl @@ -0,0 +1,283 @@ + + + + + + + + + + + empty + empty + empty + empty + empty + empty + empty + empty + empty + empty + empty + empty + empty + empty + empty + empty + empty + empty + empty + empty + empty + empty + empty + empty + empty + empty + empty + empty + empty + empty + empty + empty + empty + empty + empty + empty + empty + empty + empty + empty + empty + empty + empty + empty + empty + empty + empty + empty + empty + empty + empty + empty + empty + empty + empty + + + + + + + a8 + a9 + b9 + + + + + + + + + a6 + a7 + b7 + + c8 + c9 + d9 + + + + + + a5 + b5 + b6 + c6 + c7 + d7 + d8 + e8 + e9 + + + + + b4 + c4 + c5 + d5 + + e6 + e7 + f7 + f8 + + + + + c3 + d3 + d4 + + e5 + + f6 + g6 + g7 + + + + + d2 + + e3 + f3 + f4 + g4 + g5 + + h6 + + + + + e1 + f1 + f2 + g2 + g3 + h3 + h4 + i4 + i5 + + + + + + + g1 + h1 + h2 + i2 + i3 + + + + + + + + + + + i1 + + + + + + + + + + +
It is 's turn. They have seeds in hand.
a8
a9
b9
a6
a7
b7
c8
c9
d9
a5
b5
b6
c6
c7
d7
d8
e8
e9
b4
c4
c5
d5
e6
e7
f7
f8
c3
d3
d4
e5
f6
g6
g7
d2
e3
f3
f4
g4
g5
h6
e1
f1
f2
g2
g3
h3
h4
i4
i5
g1
h1
h2
i2
i3
i1