day 21 part2, 1st version. Need improvement in queue management (!)
This commit is contained in:
@@ -36,3 +36,22 @@ This is how the game would go:
|
||||
Since player 1 has at least 1000 points, player 1 wins and the game ends. At this point, the losing player had 745 points and the die had been rolled a total of 993 times; 745 * 993 = 739785.
|
||||
|
||||
Play a practice game using the deterministic 100-sided die. The moment either player wins, what do you get if you multiply the score of the losing player by the number of times the die was rolled during the game?
|
||||
|
||||
Your puzzle answer was 989352.
|
||||
--- Part Two ---
|
||||
|
||||
Now that you're warmed up, it's time to play the real game.
|
||||
|
||||
A second compartment opens, this time labeled Dirac dice. Out of it falls a single three-sided die.
|
||||
|
||||
As you experiment with the die, you feel a little strange. An informational brochure in the compartment explains that this is a quantum die: when you roll it, the universe splits into multiple copies, one copy for each possible outcome of the die. In this case, rolling the die always splits the universe into three copies: one where the outcome of the roll was 1, one where it was 2, and one where it was 3.
|
||||
|
||||
The game is played the same as before, although to prevent things from getting too far out of hand, the game now ends when either player's score reaches at least 21.
|
||||
|
||||
Using the same starting positions as in the example above, player 1 wins in 444356092776315 universes, while player 2 merely wins in 341960390180808 universes.
|
||||
|
||||
Using your given starting positions, determine every possible outcome. Find the player that wins in more universes; in how many universes does that player win?
|
||||
|
||||
Your puzzle answer was 430229563871565.
|
||||
|
||||
Both parts of this puzzle are complete! They provide two gold stars: **
|
||||
|
Reference in New Issue
Block a user