- #1
spyrustheviru
- 19
- 0
So, I was playing a game with some friends played with dice, and I though it would be interesting to see how a computer can be programmed to play it. I don't know it's name, but I'll explain and then phrase the problem:
Each player has 5 dice. Round begins, everyone rolls their dice secretly and look at them.
First, one player(first time it's random, then its the winner of the las round or game) bets on the minimum times of occurence of a certain number. Number six has been replaced by a star, which I'll explain further down. The bet has a minimum of 1 and maximum of 20. Then, the next player can either place a new bet, or state that the previous player is wrong.
The new bet must follow these rules:
1. If he wants to state the same number of occurence as the previous player, he must raise the number for which he is beting. For exaple, if George says there are 4 threes and then Mary cannot bet 4 twos, but she can bet 4 fives.
2.The number of occurences can be raised (not lowered), and then the player is free to bet on a new number. In the previous example, where George said 4 threes, Mary can say 5 ones or 14 fours, but she may not call 1 six .
3. A player can bet a star only on the "star blocks", which are explained below.
3. In normal blocks a player can bet on any number exept for star. On a star block he can bet only on star. They are positioned like this:
1. 1-normal
2. 1-star
3. 2-normal
4. 3-normal
5. 2-star
6. 4-normal
7. 5normal
8. 3-star
etc until
29. 10-star
30. 20-normal
the bet can only progress downwards, so Mary could bet 3 star after George's 4 threes(but not 1 star)
Players continue to bet until someone decides to bust the bet. Everyone shows their dice and the bet is checked like this:
if the bet was about a normal number, we count the occurences of this number plus these of the stars. If the resulting number is lower than the bet, the player who placed it loses (bet-actual number) dice. Else, the disputing player loses that same number of dice. Should these numbers be the same(the above difference is zero), everyone but the betting player loses one die. Should the bet was about stars we count only the stars, and procced with removing the nessesary dice like above. Then a new round begins, and the player who won the last one places his bet first. If a player is out of dice he's out of the game. Winner is the last man standing.
I hope I explained it well enough. Now, to the problem:
While playing, a player would calculate, based on his dice, what the results of others may be, and bet accordingly. If that was the only criteria, things where simple, you calculate the chances and then bet the most propable result. However, the fun of the game is the fact that a player can bluff, and bet on things he cannot know, or at least with very little certainty, pretty much like in a poker game. Also, a pretty good strategy is to push a bet a long way, bringing the next player in a tough position, and hopefully make him lose(place a crazy bet or open your a bit crazy bet and lose).
How could all of the above be programmed in python(thats the only language I have learned so far)? I think the main element is propability, but how do we introduce the not strickly mathematical strategies, in a mathematical way?
long post, but I think it's interesting enough so it's worth it :P
Each player has 5 dice. Round begins, everyone rolls their dice secretly and look at them.
First, one player(first time it's random, then its the winner of the las round or game) bets on the minimum times of occurence of a certain number. Number six has been replaced by a star, which I'll explain further down. The bet has a minimum of 1 and maximum of 20. Then, the next player can either place a new bet, or state that the previous player is wrong.
The new bet must follow these rules:
1. If he wants to state the same number of occurence as the previous player, he must raise the number for which he is beting. For exaple, if George says there are 4 threes and then Mary cannot bet 4 twos, but she can bet 4 fives.
2.The number of occurences can be raised (not lowered), and then the player is free to bet on a new number. In the previous example, where George said 4 threes, Mary can say 5 ones or 14 fours, but she may not call 1 six .
3. A player can bet a star only on the "star blocks", which are explained below.
3. In normal blocks a player can bet on any number exept for star. On a star block he can bet only on star. They are positioned like this:
1. 1-normal
2. 1-star
3. 2-normal
4. 3-normal
5. 2-star
6. 4-normal
7. 5normal
8. 3-star
etc until
29. 10-star
30. 20-normal
the bet can only progress downwards, so Mary could bet 3 star after George's 4 threes(but not 1 star)
Players continue to bet until someone decides to bust the bet. Everyone shows their dice and the bet is checked like this:
if the bet was about a normal number, we count the occurences of this number plus these of the stars. If the resulting number is lower than the bet, the player who placed it loses (bet-actual number) dice. Else, the disputing player loses that same number of dice. Should these numbers be the same(the above difference is zero), everyone but the betting player loses one die. Should the bet was about stars we count only the stars, and procced with removing the nessesary dice like above. Then a new round begins, and the player who won the last one places his bet first. If a player is out of dice he's out of the game. Winner is the last man standing.
I hope I explained it well enough. Now, to the problem:
While playing, a player would calculate, based on his dice, what the results of others may be, and bet accordingly. If that was the only criteria, things where simple, you calculate the chances and then bet the most propable result. However, the fun of the game is the fact that a player can bluff, and bet on things he cannot know, or at least with very little certainty, pretty much like in a poker game. Also, a pretty good strategy is to push a bet a long way, bringing the next player in a tough position, and hopefully make him lose(place a crazy bet or open your a bit crazy bet and lose).
How could all of the above be programmed in python(thats the only language I have learned so far)? I think the main element is propability, but how do we introduce the not strickly mathematical strategies, in a mathematical way?
long post, but I think it's interesting enough so it's worth it :P