Download the Tic-Tac-Toe game (also known as Noughts & Crosses) coded in Microsoft's newest web framework, Blazor WebAssembly.
Tic-Tac-Toe is where you have 2 players on a 3 x 3 grid. One of the players uses the 'O' mark (or noughts). The other play uses the 'X' mark (or crosses).
Each player takes alternate turns. The aim of the game is to get three in a row with their mark. They can either three in a row horizontally, vertically or diagonally. If no one gets three in a row, the game is drawn.
This ASP.NET Core example is built up using C# and Razor component's. Not only can you play the game with this example, you can also keep track of the score, and reset the game.
This is the software that will need to be installed onto your machine.
- Visual Studio 2019. Version 16.8.4 or above (may work with lower versions). It will work with the free community version.
- .NET 5.0 SDK, or above.
Get The Application Working
These are the steps to get the application working.
- Fill out the source code form. We will send you an email where you can download the source code.
You are now ready to go.
Open the Project in Visual Studio
RoundTheCode.TicTacToe.sln in Visual Studio.
Start the project in Visual Studio.
https://localhost:4000, and you can now play Tic-Tac-Toe in your web browser.
This example was done as part of a live coding challenge that we did in YouTube.
We had an hour to code the application. Within that hour, we had to design the application, and build up the functionality. We also built a scoreboard for the game.
Have a watch back of our live stream to see how we went about building it.
In-addition, read about how we created Tic-Tac-Toe in Blazor WebAssembly. Find out what approach we took, how we built up the application and see the code snippets used.