diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..53b061a --- /dev/null +++ b/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true \ No newline at end of file diff --git a/gothok/README.md b/gothok/README.md new file mode 100644 index 0000000..fe31d9c --- /dev/null +++ b/gothok/README.md @@ -0,0 +1,25 @@ +# A Game of Thrones: Hand of the King + +See [rules][rules]. This is a very toned down version of the game, without the companion cards as that reduces the state space by a lot (since all house cards can be treated as identical) + +Card lists can be found at the following 2 images: + +- [Characters](https://boardgamegeek.com/image/3687891/game-thrones-hand-king?size=original) +- [Companions](https://cf.geekdo-images.com/images/pic3253090.jpg) + +## Setup: + +1. Shuffle the following string: SSSSSSSSGGGGGGGLLLLLLTTTTTBBBBYYYUUV +2. Fit it into a 6x6 grid + +## Play: + +1. Check for valid moves (Max = 10) from (5 in east/west and 5 in north/south directions). +2. Declare for a house and move Varys to the corresponding character. This must be the farthest card for that house in that direction. +3. Collect the card, and gain the banner token for that house if you have the highest number of cards for that House (This can be made simpler by giving you the token if you have a proven majority) + +## Score + +If there are no legal moves left in the game, check number of tokens held by each player. Highest banner token player wins. + +See my previous python implementation of the game at https://raw.githubusercontent.com/captn3m0/gothok \ No newline at end of file diff --git a/gothok/state.capnp b/gothok/state.capnp new file mode 100644 index 0000000..fd1e5ba --- /dev/null +++ b/gothok/state.capnp @@ -0,0 +1,35 @@ +@0xdcf6fa9421875ce0; + +enum House { + stark @8; + greyjoy @7; + lannister @6; + targaryen @5; + baratheon @4; + tyrell @3; + tully @2; + varys @1; +} + +struct Location { + union { + # Is card on the board + board :group { + x @0 :UInt8 = 0; + y @1 :UInt8 = 0; + } + # Or held by a player + player :group { + index @2 :UInt8 = 0; + } + } +} + +struct Card { + house @0 :House; + location @1 :Location; +} + +struct State { + cardlist @0 :List(Card); +}