Game developed with C language. There are 3 modes for this game:
- Player vs Player
- Player vs Smart AI Computer
- Player vs Random AI Computer
Code is developed in Linux and compiled using gcc. To run the code, compile and run in Terminal with:
gcc PlayerVsComputer.c && ./a.out
Algoritm used for Smart AI is reactive planning algorithm:
- If the computer can immediately win on its current move, it will play the winning move and ends the game.
- If the opponent is about to win on the next move, it can block the opponents’ winning move.
- If neither above 2 scenarios occurs, the computer falls back to the random AI.
Players takes turn to play as shown below.
Since the AI does not have strategies to win as it only plays based on conditions, the AI will not always win/draw. Hence, the result of the AI vs AI is shown below:
Additional information about the research can be found here