A simple web-based Tic-Tac-Toe game built with Kotlin and Ktor.
Note: The demo is hosted on a free hosting service, so initial loading may be slow. Please be patient.
- Player vs Computer: Play against a simple AI opponent
- Player vs Player: Play against another human player on the same device
- Responsive Design: Works on desktop and mobile devices
- Game Statistics: Track wins, losses, and draws
- Open the game in your web browser
- Select a game mode:
- Player vs Computer: You play as X against the computer (O)
- Player vs Player: Two players take turns (Player 1 is X, Player 2 is O)
- Click on an empty cell to make a move
- The game will automatically detect wins or draws
- Click "New Game" to start a new game
In this mode, you play as X against the computer, which plays as O. The computer uses a simple algorithm to make its moves.
In this mode, two players take turns making moves on the same device. Player 1 plays as X and Player 2 plays as O.
This game is built with:
- Kotlin
- Ktor web framework
- Thymeleaf templates
- HTML/CSS/JavaScript
To run the game locally:
- Clone the repository
- Make sure you have Java and Gradle installed
- Run
./gradlew runfrom the project root - Open your browser and navigate to
http://localhost:8080
To run the game using Docker:
- Clone the repository
- Make sure you have Docker and Docker Compose installed
- Run
docker-compose upfrom the project root - Open your browser and navigate to
http://localhost:8080
Alternatively, you can build and run the Docker image directly:
# Build the Docker image
docker build -t tictactoe .
# Run the container
docker run -p 8080:8080 tictactoeThis project is open source and available under the MIT License.