Liar's Dice is a fairly simple dice game. I've seen a few different variations of the rules, but here is the version I'm most familiar with:
- Each player starts with 5d6
- Except when tallying the dice at the end of a round, each player may see their own dice, but not those of any opponent
- At the start of any given round, all players roll whatever dice they currently have
- Then, one player (usually, this is either the winner of the previous round OR the player to the left of the player who started last time; we'll be using the former for this KotH; with a random player starting the first round) makes a guess about how many of a particular number are on the table (ONES ARE WILD)
- Bidding continues to the right, going higher each time (for instance; 3 fives, 3 sixes and 4 twos are all higher than 3 fours, but 3 threes is not; 4 ones is also higher but bidding on ones will probably put you at a disadvantage); until any player calls the player preceding them a liar
- At this point, all players reveal their dice and count the number of the last number bid on on the table altogether
- If the total is lower than the bid, the player who made the bid must give a die to the player who called them a liar, otherwise, the player who called the bidder a liar must give a die to the bidder (so the bidder wins if their are at least as many of that number as he had bid, there don't have to be the exact number)
- When you run out of dice, you lose
- The last player standing wins
For example:
Player one has 1,1,2,4,6 Player two has 1,2,2,3,5 Player three has 1,3,3,4,6 Player one: three sixes. Player two: four twos. Player three: four threes. Player one: five twos. Player two: six twos. Player three: six threes. Player one: six fours. Player two: Liar! They reveal their dice and count up the ones (because ones are wild) and the fours. It turns out that there are, in fact, exactly six fours. So player two gives player one a die. They reroll and player one starts the next round.
You must write a bot to play this game. It must implement the following abstract java class:
public abstract class Player {
public Player() {}
public String toString() {
return this.getClass().getSimpleName();
}
public abstract String bid(int yourId, int[] diceEachPlayerHas, int[] yourDice, String[] bids);
}
- You must implement the bid method
- The first argument is your bot's current position in the turn order, the second is an array showing how many dice each player (including yourself) currently has, the third is an array showing the values currently shown on your own dice, and the fourth is an array of all bids made since the start of the current round - will have length 0 if you are making the first bid of the round
- The output should be either a string of the form "number face", or the string "Liar!" to call the previous bidder a liar.
- If your output is formatted illegally, you will be eliminated.
- You may override the toString method, but are not required to. However, you may not edit it in any way that interferes with the readability of the controller's output.
- You are permitted to call any other public methods of the controller, but not its main method.
- You may read and edit only files in the running directory prefixed with your bot's own name
- You are not permitted to take input from any other source
- Instance variables are reset at the start of each new game, but static variables are not.
Scoring
- One set of 1,000 games, with 3-5 players in each, will be simulated each time a bot is added (as soon as three or more bots have been submitted), scored as shown in the controller source (in any given game, you get 1 at the start of each of your turns, 10 each time you capture a die, and 1,000 bonus if you win); enforcing a limit of 5,000 TURNS (not rounds) each game.
- Your bot will be scored by its score from the latest set of games; plus ten times its vote score, if nonnegative. (The latter is unlikely to have a significant effect on the score)
The controller source can be found here.
Scores as of 2015-06-19:
Badnomial: 434,924 + 6x10 = 424,984
Nobody: 282,329 + 6x10 = 282,389
StraightShooter: 265,205 + 5x10 = 265,255
MostlyHonestAbe: 158,958 + 4x10 = 158,998
The Pirate: 157,005 + 1x10 = 157,015
Statistician: 144,012 + 2x10 = 144,032
Fidelio: 49,973 + 2x10 = 49,993
Absurd Bot: 6,831
DrHouse: 2,638 + 3x10 = 2,668
diceEachPlayerHas[yourId]
= your dice count, andbids[yourId]
is your first bid (or null if it's your first turn). Is that correct? \$\endgroup\$