I\'m creating a TicTacToe class that contains a 3 by 3 rectangular array of integers & is played by 2 human players. \"1\" is used for the first player\'s move & \"2\" i
I wont code it for you but here is the logic you can use:
1) For each column check if all rows are the same, if yes declare winner. If not go to step 2.
2) For each row check if all column values are the same, if yes declare winner. If not go to step 3.
3) Now check diagonals, there are only two possibilities here [0,0] [1,1] [2,2] and also [0,2] [1,1] [2,0] if they are the same declare winner, if not check whether all values in array are filled, if yes declare draw if not make users enter values.