Description
The squares are labelled as 1 to 9 from left to right from the top to bottom row
Player goes first and player is X, vice versa
Checks
Program checks for win condition which is stored as a variable
Program check if there are any combinations of winning patterns or if the board is full
Options
Options are stored as a list and after each turn
Option by player is selected by input dialog by converting list into array, option by computer is selected by creating random number from list index
Options selected are removed from list at end of turn
Board
Board is stored as a length 9 array with blanks which will be filled in subsequently
Potential Fixes include add some AI to prevent the robot from losing to the player.
Code Repository
[https://github.com/gluonn/UiPath/blob/master/TicTacToe.xaml]