A multiplayer strategy game that combines traditional TicTacToe with hidden information and probability mechanics.
The game uses a 3x3 board with 9 hidden pieces. Each board contains exactly 5 pieces of one symbol (X or O) and 4 of the other, but players don't know which symbol has the majority. Every piece shows probability percentages that update as the game progresses.
Placement Phase: Players alternate placing pieces on empty cells. All symbols remain hidden.
Reveal Phase: Players take turns revealing pieces to find their symbols and form three in a row.
The key challenge is using probability information and deduction to make strategic decisions about where to place and reveal pieces.
- 3x3 grid with 9 total pieces
- Exactly 5 of one symbol, 4 of the other
- Players don't know which symbol they need
- Each piece displays probability percentages (randomly assigned which number represents X or O)
- Probabilities update after each reveal following Monty Hall theorem to determine the new percentages
- Win by getting 3 symbols in a row, column, or diagonal
- Two phases: placement then reveal
- Frontend: React with TypeScript
- Backend: FastAPI with WebSocket communication
- Real-time multiplayer with room-based matchmaking
- Server-authoritative game logic
- Python 3.8 or higher
- Node.js 16 or higher
- npm package manager
-
Navigate to backend directory:
cd backend -
Create virtual environment:
python -m venv venv venv\Scripts\activate # Windows source venv/bin/activate # macOS/Linux
-
Install dependencies:
pip install -r requirements.txt
-
Run server:
python main.py
Server runs on http://localhost:8000
-
Navigate to frontend directory:
cd frontend -
Install dependencies:
npm install
-
Start development server:
npm start
Frontend runs on http://localhost:3000
- Open http://localhost:3000 in two browser windows
- One player creates a room and shares the room code
- Second player joins using the room code
- Game starts automatically when both players are ready
The backend uses in-memory storage, so rooms reset when the server restarts. For production use, consider adding persistent storage.
WebSocket endpoints:
GET /create_room- Create new roomWebSocket /ws/{room_code}- Game communication
Game state is managed server-side to prevent cheating.