💡 Feature Request: Randomized First Move Selection (User vs. AI)
Description
Currently, the Dots and Boxes game defaults to a fixed starting player (e.g., the human player always goes first). To make the game more dynamic, replayable, and fair, we need to introduce a randomized coin-flip mechanic at the start of each single-player match. This feature will randomly decide whether the human user or the AI gets to make the first move.
User Experience (UX) Flow
- The user navigates to the Dots and Boxes game page and clicks "Start Game" (against AI).
- The system runs a backend/frontend randomization check (50/50 chance).
- A brief visual indicator or toast notification informs the player who goes first (e.g., "Coin flipped! You go first" or "AI won the toss! AI is thinking...").
- The designated player's turn begins, and the UI turn-indicator updates accordingly.
Proposed Technical Implementation
- Randomization Logic: Implement a simple math utility to determine the starter:
const chooseFirstPlayer = () => Math.random() < 0.5 ? 'USER' : 'AI';
@steam-bell-92 , I WANT TO GET ASSIGNED UNDER THIS ISSUE , GSSOC 26'.
💡 Feature Request: Randomized First Move Selection (User vs. AI)
Description
Currently, the Dots and Boxes game defaults to a fixed starting player (e.g., the human player always goes first). To make the game more dynamic, replayable, and fair, we need to introduce a randomized coin-flip mechanic at the start of each single-player match. This feature will randomly decide whether the human user or the AI gets to make the first move.
User Experience (UX) Flow
Proposed Technical Implementation