Adds gothok

This commit is contained in:
Nemo 2018-01-28 04:44:27 +05:30
parent 3b35766d01
commit 8c649b3be6
3 changed files with 69 additions and 0 deletions

9
.editorconfig Normal file
View File

@ -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

25
gothok/README.md Normal file
View File

@ -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

35
gothok/state.capnp Normal file
View File

@ -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);
}