Results 1 to 2 of 2
Thread: help on my tictactoe program
- 05-24-2012, 01:21 AM #1Member
- Join Date
- May 2012
- Rep Power
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.
- 05-24-2012, 03:48 AM #2
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.
- By _inase in forum New To JavaReplies: 1Last Post: 09-12-2011, 01:53 PM
- By Nghasemi in forum New To JavaReplies: 2Last Post: 04-19-2011, 03:10 AM
- By jokerboy123 in forum New To JavaReplies: 1Last Post: 01-22-2011, 02:29 AM
- By Thomas Covington in forum New To JavaReplies: 1Last Post: 04-10-2008, 04:51 AM
- By Joe3161 in forum New To JavaReplies: 4Last Post: 11-25-2007, 07:47 PM