Page 2 of 2 FirstFirst 12
Results 21 to 22 of 22
  1. #21
    Mikki is offline Member
    Join Date
    Jun 2012
    Posts
    16
    Rep Power
    0

    Default Re: Tic Tac Toe game - winning logic not working.

    I don't think that's got any thing to do with this program. I have tried using a char[][] array as well to store the 'x' and 'O', but still its not working for some cases. I think its the way I am assiging value to pos[][]. For ex.
    First I click box (0,0)-its Player x turn
    The debug output:
    pos[][]:X row:0 col:0
    Then I click (0,1),-its Player O turn
    The debug output:
    pos[][]:O row:0 col:0
    pos[][]:O row:0 col:1
    Then I click (0,2),its Player x turn
    pos[][]:x row:0 col:0
    pos[][]:x row:0 col:1
    pos[][]:x row:0 col:2

    As you can see, what ever player is playing all the values in the array gets changed to reflect that.

  2. #22
    Mikki is offline Member
    Join Date
    Jun 2012
    Posts
    16
    Rep Power
    0

    Default Re: Tic Tac Toe game - winning logic not working.

    I sorted it out. Nothing was wrong with the winning logic.....as I mentioned, it was the way I was assigning value to the pos[][] array.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Game using swings not working
    By humanbeing in forum Java Gaming
    Replies: 7
    Last Post: 10-06-2010, 03:04 PM
  2. Logic not working
    By Prajin in forum AWT / Swing
    Replies: 1
    Last Post: 07-19-2010, 07:54 PM
  3. Game Help.working on it for days,.
    By xSkittlesx in forum Java Applets
    Replies: 12
    Last Post: 05-31-2010, 03:24 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •