When in doubt, get the hammer!
When in doubt, get the hammer!
When in doubt, get the hammer!
Originally posted by Gregg Bolinger:
Ok, so here is what I would do. At least something like this.
Create a matrix to hold your x's and o's
char matrix[][] = new char[3][3];
When a button is clicked determine which position in the matrix to update:
matrix[2][1] = "X";
After which, you check the rows, cols, and diags:
When in doubt, get the hammer!
When in doubt, get the hammer!
When in doubt, get the hammer!
When in doubt, get the hammer!
When in doubt, get the hammer!
When in doubt, get the hammer!
When in doubt, get the hammer!
Originally posted by James Mousseau:
And I was wondering if this could be an alternate ending to this massacre:
But the thing is I get an error saying its not boolean or something for the line "if (box1.setText = "X" && box2.setText ("X") && box3.setText("X"))"
Is there a way to set it up that way, or is it undoable?
[ June 11, 2008: Message edited by: James Mousseau ]
Edward Smith
When in doubt, get the hammer!
Edward Smith
When in doubt, get the hammer!
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |