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.
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.