This tic tac toe game is written in C, developed just to learn the C syntax.
We have seven functions other than main, and there are:
player_turn()
= here we have all the logic about the player when it has to place the signbot_turn()
= is the same as the player_turn, but here the bot choose a place where to put his sign randomlydisplay_table()
= we call this function every time we have to display the board, updated with the moves made by the playerscheck_win()
= here we check if any of the player has win (tris) by checking the rows, columns and diagonalsgame()
= in this function all the game run, assign all the turns, display the table and check for a winnerchoose_sign()
= this function is called once at the beginning, the player can choose either of the two sign, the bot will be assigned with the sign leftshow_game_winner()
= this last function is called when we have a winner, will print to the user if it has lost or not