Tic Tac Toe


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


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 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 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


uploads_5d5e5aac-5f07-4f62-a66b-9ffff58eb6de_Capture1 uploads_5d5e5aac-5f07-4f62-a66b-9ffff58eb6de_Capture2 uploads_5d5e5aac-5f07-4f62-a66b-9ffff58eb6de_Capture3 uploads_5d5e5aac-5f07-4f62-a66b-9ffff58eb6de_Capture5

1 Like

Hi @Gluon

Can you share us the xaml

It’s interesting :):smiley:

TicTacToe.xaml (23.7 KB)

There you go @AshwinS2