Results 1 to 2 of 2
  1. #1
    javastudent22 is offline Member
    Join Date
    May 2012
    Posts
    1
    Rep Power
    0

    Default help on my tictactoe program

    Hi, I need help finishing my tictactoe program, I'm using netbeans. I set it up in a GUI and have it so that whenever a button is clicked, the text on it will turn into an "x" or an "o." But I cannot figure out how to make it so that when there are three in a row the program will recognize it and there will be a winner.

  2. #2
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,789
    Rep Power
    7

    Default Re: help on my tictactoe program

    Without seeing any of your code you expect us to know what your problem is?

    You can simply use brute force to check for a winner. Just see if the "value" in three consecutive squares are the same. Check rows, check columns check diagonals. You can do this in a method that returns true as soon as it finds three values that match.

Similar Threads

  1. infamous tictactoe program...
    By _inase in forum New To Java
    Replies: 1
    Last Post: 09-12-2011, 01:53 PM
  2. I need help with my TicTacToe
    By Nghasemi in forum New To Java
    Replies: 2
    Last Post: 04-19-2011, 03:10 AM
  3. Help with TicTacToe
    By jokerboy123 in forum New To Java
    Replies: 1
    Last Post: 01-22-2011, 01:29 AM
  4. TicTacToe
    By Thomas Covington in forum New To Java
    Replies: 1
    Last Post: 04-10-2008, 04:51 AM
  5. TicTacToe
    By Joe3161 in forum New To Java
    Replies: 4
    Last Post: 11-25-2007, 06:47 PM

Tags for this Thread

Posting Permissions

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