Tris is a multiplayer Tic Tac Toe game built with Streamlit.
Why Tris? Because it's the Italian name for "Tic Tac Toe". ๐ฎ๐น
Try it out at playtris.streamlit.app
Tris has a fascinating history: it was played in ancient Rome under the name "terni lapilli" by Roman soldiers. In 1952, it made computer science history as the first game ever played by a computer, through a program called OXO developed for the EDSAC computer.
The game is particularly interesting from a computer science perspective as it's:
- A perfect information game
- A zero-sum game
- Has a known "perfect strategy" (Nash equilibrium)
- Often used to teach game theory and AI basics
- Multiplayer Mode: Play with friends by sharing a unique match link
- AI Player: Test your skills against our AI
- Easy Sharing: Quick game sharing via WhatsApp
- Modern UI: Clean interface with responsive design
- Cache Resource and Session state for game management
- Dialogs for smooth interactions
- Custom CSS for that extra polish
- Latest released feature "segmented control" for game mode selection
- Clone the repository
git clone https://github.com/fabiogra/tris.git
cd tris
- Install dependencies
pip install -r requirements.txt
- Run the app
streamlit run app/main.py
The game is played on a 3x3 grid. Players take turns marking empty cells with their symbol (traditionally X and O). The winner is the first player to get three of their symbols in a row - horizontally, vertically, or diagonally. If all cells are filled without a winner, the game is a draw (known as "patta" in Italian chess terminology).
- Visit playtris.streamlit.app
- Choose your game mode (Multiplayer or AI)
- For multiplayer:
- Create a new match
- Share the link with your friend
- Start playing when they join!
- For AI mode:
- Toggle "Play against AI"
- Create a new match
- Play against our AI!
This project is licensed under the MIT License - see the LICENSE file for details