Welcome to the TicTacToe Blazor Web Assembly project with an AI opponent! This is a simple implementation of the classic Tic-Tac-Toe game using Blazor Web Assembly, now with MAUI Blazor support. In this version, you'll be challenging an AI opponent in the timeless battle of X's and O's on both desktop and mobile.
You can try out the live demo of the TicTacToe game here.
- Work on Browser, Mobile, and Native Desktop app using MAUI.
- Play against an AI opponent.
- Interactive game board.
- Real-time feedback on game status.
- Multiplayer (Co-op)
- Online Multiplayer WIP
For a detailed explanation of how this project was built, check out our blog posts Let's Build a Tic Tac Toe Game with Blazor WebAssembly! and Bringing Blazor to Desktop and Mobile with MAUI
To get started with this TicTacToe Blazor Web Assembly project locally, follow these steps:
-
Clone the repository:
git clone https://github.com/mhdbouk/tictactoe-blazor.git cd tictactoe-blazor
-
Build and run the project:
Make sure you have the .NET 7 SDK installed.
dotnet build dotnet run
-
Open in your browser:
Open your preferred web browser and navigate to
https://localhost:7205
.
- Select the playing mode (AI, 2 Players, Online)
- When selecting AI, you play as "X" and the AI opponent plays as "O".
- Click on the empty cells of the game board to place your move.
- The AI opponent will make its move automatically.
- The game will automatically detect a win, loss, or draw and display the result.
- To start a new game, click on the Restart button.
Contributions are welcome! If you'd like to contribute to this project, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and commit them with descriptive commit messages.
- Push your changes to your fork.
- Create a pull request to the
main
branch of this repository.
This project is licensed under the MIT License.