Android Advance

Creating Conditional Function.

views

8:05
Now we will call the function areThreeInLine().If there are three ‘X’s or ‘O’s in a line, then this function will return true, otherwise it will return false. We will see in detail how this function works later. In case this function returns true and it is the turn of the first player, then we will increase his score by 1 and show a toast that the first player has won and we will update the text in the TextView. If the second player has won then we will do all of this for the second player.