- Simple number game involving two players
- Game starts with a number (positive integer)
- Two players take turns to either subtract 1 or divide by 2
- Whoever reduces the number to zero wins
- Minimal implementation
- Player 1 moves first and is the human player
- Player 2 is the AI agent using minimax algorithm
- HTML/CSS for UI, JavaScript for game logic
- Current number
n - Two buttons
Subtract 1andDivide by 2to collect human player input
- Simulates the game until game end and picks the best outcome (recursion)
- Assumes both players play optimally
- On the agent's turn, it picks the action that maximizes outcome for agent
- On the opponent's turn, it picks the action that minimizes outcome for agent
