Ask AI
Open a hint-first prompt in a new AI chat. Grok may ask you to confirm before sending.
Open Claude Desktopgame-theory · dynamic-programming · minimax
The organizer’s problem statement is available at the official source link.
two pile minimax
Analyze the two-pile game with alternating max and min turns
State (x,y) gives the bead counts. The turn depends on x+y parity, and each visited state contributes f(x,y) to the score.
| State | Player to move | Choice |
|---|---|---|
| (x,y) | x+y even: you | move (x-1,y+1) or (x,y-1) |
| (x,y) | x+y odd: opponent | minimize your eventual score |
| position payoff | f(x,y)=A*x^2 + B*y^2 + C*x*y |
- 1
Read state and turn
At state (x,y), it is your turn when x+y is even; otherwise it is the opponent's turn. - 2
Apply one legal move
Move one bead from the first bowl to the second, or remove one bead from the second bowl. - 3
Evaluate the game
Add f(x,y) at each visited state; you maximize the total and the opponent minimizes it.
Tools
1
2
3
4
5
6
7
8
9
10
11
12
Draft saved locally
|12 lines, 156 charsRun output
Run your code to see output.