From e64bacb7badf20b2e6a793f5aec48ede30f7dad2 Mon Sep 17 00:00:00 2001 From: Nemo Date: Tue, 21 Jul 2020 11:44:19 +0530 Subject: [PATCH] Adds 4 player game --- README.md | 2 +- games/05.json | 28 ++++++++ games/05.md | 195 ++++++++++++++++++++++++++++++++++++++++++++++++++ modernart.mzn | 2 +- 4 files changed, 225 insertions(+), 2 deletions(-) create mode 100644 games/05.json create mode 100644 games/05.md diff --git a/README.md b/README.md index e8ae3aa..7978137 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ This is a [MiniZinc](https://www.minizinc.org/) based attempt to solve the [Modern Art: Masters Gallery](https://boardgamegeek.com/boardgame/40381/masters-gallery) game. -The current partial implementation (see below for missing rules) results in a highest possible score of 301 for a 2 player game. See [games/04.md](games/04.md) for the complete episode. There are a few more games available in [the games directory](games/) +The current partial implementation (see below for missing rules) results in a highest possible score of 301 for a 2 player game. See [games/04.md](games/04.md) for the complete episode. There are a few more games available in [the games directory](games/). ## Plan diff --git a/games/05.json b/games/05.json new file mode 100644 index 0000000..ad2eff9 --- /dev/null +++ b/games/05.json @@ -0,0 +1,28 @@ +{ + "visible_count_per_round_per_artist_per_player" : [[[0, 0, 2, 2, 0], [0, 4, 0, 0, 0], [0, 2, 1, 0, 0], [3, 0, 0, 0, 0]], [[3, 0, 0, 1, 0], [3, 1, 0, 0, 0], [0, 0, 4, 0, 0], [0, 4, 0, 0, 0]], [[3, 0, 0, 0, 0], [3, 0, 0, 0, 0], [0, 0, 2, 1, 0], [0, 3, 0, 0, 0]], [[1, 0, 4, 0, 0], [5, 0, 0, 0, 0], [0, 0, 0, 3, 2], [0, 5, 0, 0, 0]]], + "first_player" : [{"e":"Player1"}, {"e":"Player3"}, {"e":"Player2"}, {"e":"Player2"}], + "last_player" : [{"e":"Player2"}, {"e":"Player1"}, {"e":"Player1"}, {"e":"Player1"}], + "total_score_per_round_per_artist" : [[1, 3, 2, 0, 0], [4, 5, 3, 0, 0], [7, 7, 4, 0, 0], [10, 9, 5, 0, 0]], + "CardsForArtist" : [[3, 6, 3, 2, 0], [6, 5, 4, 1, 0], [6, 3, 2, 1, 0], [6, 5, 4, 3, 2]], + "NominalTurnCount" : [4, 4, 3, 5], + "Score" : [67, 100, 28, 89], + "MaxVisibleCards" : 6, + "TotalCardsPlayed" : [[4, 4, 3, 3], [4, 4, 4, 4], [3, 3, 3, 3], [5, 5, 5, 5]], + "StartingCardsInHand" : [[13, 13, 13, 13], [13, 13, 14, 14], [14, 14, 14, 14], [11, 11, 11, 11]], + "CardsDealtPerRound" : [13, 4, 4, 0], + "PlayableCards" : [[13, 13, 13, 13], [14, 14, 14, 14], [14, 14, 14, 14], [13, 11, 12, 11]], + "sorted_artists_per_round" : [{"e":"KarlGitter"}, {"e":"ChristinP"}, {"e":"Krypto"}, {"e":"Yoko"}, {"e":"LiteMetal"}, {"e":"Krypto"}, {"e":"KarlGitter"}, {"e":"ChristinP"}, {"e":"Yoko"}, {"e":"LiteMetal"}, {"e":"Krypto"}, {"e":"KarlGitter"}, {"e":"ChristinP"}, {"e":"Yoko"}, {"e":"LiteMetal"}, {"e":"Krypto"}, {"e":"KarlGitter"}, {"e":"ChristinP"}, {"e":"Yoko"}, {"e":"LiteMetal"}], + "Pn1" : {"set":[{"e":"Player1"}, {"e":"Player2"}]}, + "Pn2" : {"set":[{"e":"Player1"}, {"e":"Player2"}, {"e":"Player3"}, {"e":"Player4"}]}, + "Pn3" : {"set":[{"e":"Player1"}, {"e":"Player2"}, {"e":"Player3"}, {"e":"Player4"}]}, + "Pn4" : {"set":[{"e":"Player1"}, {"e":"Player2"}, {"e":"Player3"}, {"e":"Player4"}]}, + "award_bonus_per_round_per_artist" : [[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]], + "AwardGiven" : [false, false, false, false, false], + "AwardPlayedInRound" : [{"e":"Round1"}, {"e":"Round1"}, {"e":"Round1"}, {"e":"Round1"}, {"e":"Round1"}], + "AwardedArtist" : [{"e":"Krypto"}, {"e":"Krypto"}, {"e":"Krypto"}, {"e":"Krypto"}, {"e":"Krypto"}], + "ranking_score_per_artist_per_round" : [[1, 3, 2, 0, 0], [3, 2, 1, 0, 0], [3, 2, 1, 0, 0], [3, 2, 1, 0, 0]], + "IsArtistRanked" : [[true, true, true, false, false], [true, true, true, false, false], [true, true, true, false, false], [true, true, true, false, false]], + "RoundScore" : [[4, 12, 8, 3], [12, 17, 12, 20], [21, 21, 8, 21], [30, 50, 0, 45]], + "ArtistScore" : [[1, 3, 2, 0, 0], [4, 5, 3, 0, 0], [7, 7, 4, 0, 0], [10, 9, 5, 0, 0]], + "DrawOneCard" : [[[false, false, false, false, false], [false, false, false, false, false], [false, false, false, false, false], [false, false, false, false, false]], [[false, false, false, true, false], [false, true, false, false, false], [false, false, false, false, false], [false, false, false, false, false]], [[false, false, false, false, false], [false, false, false, false, false], [false, false, false, false, false], [false, false, false, false, false]], [[true, false, true, false, false], [false, false, false, false, false], [false, false, false, false, true], [false, false, false, false, false]]] +} \ No newline at end of file diff --git a/games/05.md b/games/05.md new file mode 100644 index 0000000..12e7697 --- /dev/null +++ b/games/05.md @@ -0,0 +1,195 @@ + +### Round (1) +Player 1 : CCBB + +Player 2 : DDDD + +Player 3 : DDC + +Player 4 : EEE + +Count(E=Krypto) = 3 (THIRD=1) + +Count(D=KarlGitter) = 6 (FIRST=3) + +Count(C=ChristinP) = 3 (SECOND=2) + +Count(B=Yoko) = 2 + +Awards: E>Krypto, D>Krypto, C>Krypto, B>Krypto, A>Krypto + +**Artist Scores**: + +Krypto:1 + +KarlGitter:3 + +ChristinP:2 + +Yoko:0 + +LiteMetal:0 + + +**Player Scores** + +Player 1 : 4 + +Player 2 : 12 + +Player 3 : 8 + +Player 4 : 3 + + +### Round (2) +Player 1 : EEEB + +Player 2 : EEED + +Player 3 : CCCC + +Player 4 : DDDD + +Count(E=Krypto) = 6 (FIRST=3) + +Count(D=KarlGitter) = 5 (SECOND=2) + +Count(C=ChristinP) = 4 (THIRD=1) + +Count(B=Yoko) = 1 + + +**Artist Scores**: + +Krypto:4 + +KarlGitter:5 + +ChristinP:3 + +Yoko:0 + +LiteMetal:0 + + +**Player Scores** + +Player 1 : 12 + +Player 2 : 17 + +Player 3 : 12 + +Player 4 : 20 + + +### Round (3) +Player 1 : EEE + +Player 2 : EEE + +Player 3 : CCB + +Player 4 : DDD + +Count(E=Krypto) = 6 (FIRST=3) + +Count(D=KarlGitter) = 3 (SECOND=2) + +Count(C=ChristinP) = 2 (THIRD=1) + +Count(B=Yoko) = 1 + + +**Artist Scores**: + +Krypto:7 + +KarlGitter:7 + +ChristinP:4 + +Yoko:0 + +LiteMetal:0 + + +**Player Scores** + +Player 1 : 21 + +Player 2 : 21 + +Player 3 : 8 + +Player 4 : 21 + + +### Round (4) +Player 1 : ECCCC + +Player 2 : EEEEE + +Player 3 : BBBAA + +Player 4 : DDDDD + +Count(E=Krypto) = 6 (FIRST=3) + +Count(D=KarlGitter) = 5 (SECOND=2) + +Count(C=ChristinP) = 4 (THIRD=1) + +Count(B=Yoko) = 3 + +Count(A=LiteMetal) = 2 + + +**Artist Scores**: + +Krypto:10 + +KarlGitter:9 + +ChristinP:5 + +Yoko:0 + +LiteMetal:0 + + +**Player Scores** + +Player 1 : 30 + +Player 2 : 50 + +Player 3 : 0 + +Player 4 : 45 + + + +## Final Scores + +Player 1 : 67 + +Player 2 : 100 + +Player 3 : 28 + +Player 4 : 89 + + +### Info + +A=LiteMetal (17) +B=Yoko (18) +C=ChristinP (19) +D=KarlGitter (20) +E=Krypto (21) + +Since this is a 4-player game, the maximum number of visible cards for any artist is 6Scores for unranked artists are 0 for that round. + +The syntax for awards is AwardTokenArtist > Awarded Artist (ie, the Award card for `AwardTokenArtist` was played, and the award was given to the `Awarded Artist`). diff --git a/modernart.mzn b/modernart.mzn index 432baef..39309e6 100644 --- a/modernart.mzn +++ b/modernart.mzn @@ -34,4 +34,4 @@ array[Rounds] of var 0..10: NominalTurnCount; solve maximize Score[Player2]; -output outputJSON(); +output outputJSON();