This is a MiniZinc based attempt to solve the Modern Art: Masters Gallery game.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

#### 38 lines 1.2 KiB Raw Normal View History Unescape Escape

 3 years ago ```% Score a player gets in each given round ``` ```array[Rounds,Players] of var int: RoundScore; ``` ``` ``` ```% Final score of a player ``` 3 years ago ```array[Players] of var 0..500: Score; ``` 3 years ago ``` ``` ```% For Cumulative Scoring ``` 3 years ago ```% Score = ranking_score + award_score if an award was given this round ``` ```constraint forall(r in Rounds, a in Artists) ( ``` ``` total_score_per_round_per_artist[r,a] = ``` 3 years ago ``` ranking_score_per_artist_per_round[r,a] + award_bonus_per_round_per_artist[r,a] + ``` ``` if r=Round1 then ``` ``` 0 ``` ``` else ``` 3 years ago ``` total_score_per_round_per_artist[enum_prev(Rounds, r),a] ``` ``` endif ``` 3 years ago ```); ``` ``` ``` ```% This is same as total_score but force set to zero if the artist is not ranked ``` ```% This is what each player gets for each card they play ``` 3 years ago ```array[Rounds,Artists] of var 0..15: ArtistScore; ``` ```constraint forall(r in Rounds, a in Artists) ( ``` ``` ArtistScore[r,a] = if IsArtistRanked[r,a] then total_score_per_round_per_artist[r,a] else 0 endif ``` ```); ``` 3 years ago ``` ``` ```% Calculate total score per player ``` 3 years ago ```% 1. Per Round ``` ```constraint forall(r in Rounds, p in Players) ( ``` ``` RoundScore[r,p] = sum(a in Artists) ( ``` ``` visible_count_per_round_per_artist_per_player[r,p,a] * ArtistScore[r,a] ``` 3 years ago ``` ) ``` ```); ``` ``` ``` ```% 2. For the whole game ``` ```constraint forall(p in Players) ( ``` ``` Score[p] = sum(r in Rounds) (RoundScore[r,p]) ``` 3 years ago ```); ```