Those of you who like Numberphile would be familiar with Dr. James Grime, who described a non-transitive dice game on his channel.
The game consists of three 6-faced dice:
- Die 1: 3,3,3,3,3,6
- Die 2: 2,2,2,5,5,5
- Die 3: 1,4,4,4,4,4
Two players each select a die to use. They roll them and the higher die wins, best-of-whatever.
Probabilistically, die 1 beats dies 2 with >50% chance. Similarly, die 2 beats die 3, and, interestingly, die 3 beats die 1.
Write a program taking 1
, 2
or 3
as input. This indicates the die the user chooses. The program then choose the die that would beat the user and output the results of 21 rolls, and "Computer/User wins with x points
"
Rules
- Code-golf, votes as tiebreaker
- You must use RNG (or the likes) to actually simulate the dice rolls.
- I am not too strict on output format. It's okay as long as you show the dices, somehow separate between the 21 rolls (in a way different from how you separate the dice in the same roll), and output that sentence above.
- Input can be stdin, command line argument, from screen, etc.
Example
Input
1
Output
4 3
4 3
4 3
4 3
4 3
4 3
4 3
4 3
4 3
4 6
1 3
4 3
4 3
1 3
4 3
1 3
4 3
4 3
4 3
4 3
4 6
Computer wins with 16 points
Here, the user chooses die 1 and his rolls are shown on the right column. The program chooses die 3 and beats him.