shruti1305 / Learn-IT-Girl

0 stars 0 forks source link

Step-wise-explanation #2

Open akshseh opened 6 years ago

akshseh commented 6 years ago

I'll explain you the concept here. Lets create a two user game.

  1. Input the coordinates of the grid where user1 wants to mark a 'O'.
  2. store your X and O in a 3*3 array. Also, check if that spot was empty. if not, ask the same user to enter again. if yes, store the input in that spot.
  3. Now, check if any of the diagonals/rows/columns have all the 'X' (will change to 'O' in case of user2 so it goes as a parameter to the function that you have to create for this step)
  4. now change the user to user2 and repeat.

First write a pseudo-code for this on the comments here.. then we'll proceed.