Skip to content

fabiogra/tris

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tris - First Multiplayer Game in Streamlit

Tris Logo

Tris is a multiplayer Tic Tac Toe game built with Streamlit.

Why Tris? Because it's the Italian name for "Tic Tac Toe". ๐Ÿ‡ฎ๐Ÿ‡น

๐ŸŽฎ Play Now

Try it out at playtris.streamlit.app

๐ŸŽฏ About the Game

Gameplay Demo

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

โœจ Features

  • 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

๐Ÿ› ๏ธ Built With Pure Streamlit Magic

  • 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

๐Ÿš€ Quick Start

  1. Clone the repository
git clone https://github.com/fabiogra/tris.git
cd tris
  1. Install dependencies
pip install -r requirements.txt
  1. Run the app
streamlit run app/main.py

๐Ÿ“ How to Play

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).

  1. Visit playtris.streamlit.app
  2. Choose your game mode (Multiplayer or AI)
  3. For multiplayer:
    • Create a new match
    • Share the link with your friend
    • Start playing when they join!
  4. For AI mode:
    • Toggle "Play against AI"
    • Create a new match
    • Play against our AI!

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details

Releases

No releases published

Packages

No packages published

Languages