|
1 |
| -# TicTacToeApp |
| 1 | + |
| 2 | +# TicTacToe App |
| 3 | + |
| 4 | +This is the classical TicTacToe game we use to play as kids written by me in C# on .NET MAUI app framework. |
| 5 | + |
| 6 | +I bet you cannot win the logic coded into the computer's moves. |
| 7 | + |
| 8 | + |
| 9 | +## Features |
| 10 | + |
| 11 | +- *Intuitive User Interface:* Simple and easy-to-use interface for a seamless gaming experience. |
| 12 | +- *Intelligent Computer Opponent:* The computer makes intelligent moves to provide a challenging experience. |
| 13 | + - Computer checks for winning moves. |
| 14 | + - Blocks the player's potential winning moves. |
| 15 | + - Prioritizes taking the center and corners. |
| 16 | +- *Game State Management:* Automatically detects game end conditions (win, lose, draw) and restarts the game. |
| 17 | +- *Cross-Platform:* Runs on Android, iOS, Windows, and macOS. |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | +## Screenshots |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | +## Installation |
| 29 | + |
| 30 | +1. *Clone the repository:* |
| 31 | + sh |
| 32 | + git clone https://github.com/Brainydaps/TicTacToeApp.git |
| 33 | + cd TicTacToeApp |
| 34 | + |
| 35 | + |
| 36 | +2. *Build the project:* |
| 37 | + - Open the solution file TicTacToeApp.sln in Visual Studio. |
| 38 | + - Restore the NuGet packages and build the solution. |
| 39 | + |
| 40 | +3. *Run the app:* |
| 41 | + - Select the target platform (Android, iOS, Windows, or macOS) and run the application. |
| 42 | + |
| 43 | +## How to Play |
| 44 | + |
| 45 | +1. The game board consists of a 3x3 grid. |
| 46 | +2. The player always plays as "X" and the computer plays as "O". |
| 47 | +3. Click on an empty cell to make your move. |
| 48 | +4. The computer will then make its move. |
| 49 | +5. The game ends when there is a win, lose, or draw, and a message will be displayed. |
| 50 | +6. The game will automatically restart after displaying the result. |
| 51 | + |
| 52 | +## Game Logic |
| 53 | + |
| 54 | +- The computer uses a heuristic-based strategy to make its moves: |
| 55 | + - *Winning Move:* If the computer can win in the next move, it will take that move. |
| 56 | + - *Blocking Move:* If the player can win in the next move, the computer will block that move. |
| 57 | + - *Center Priority:* The computer will take the center if it is available. |
| 58 | + - *Corner Priority:* The computer will take any available corner. |
| 59 | + - *Fallback:* If none of the above, the computer will take any available cell. |
0 commit comments