I have it working now with this code:
public boolean isWon(int token) {
for (int i = 0; i < 3; i++)
if ((gameBoard[i][0] == token) && (gameBoard[i][1] == token)
&& (gameBoard[i][2]...
Type: Posts; User: FrederikB
I have it working now with this code:
public boolean isWon(int token) {
for (int i = 0; i < 3; i++)
if ((gameBoard[i][0] == token) && (gameBoard[i][1] == token)
&& (gameBoard[i][2]...
Okay! I got it all working now!
So far so good, how will i now check for a winner? :o
Updated first post with updated sourcecode
Okay, now i have this :-)
private void ClickField(int row, int field) {
if (gameBoard[row][field] == 0) {
theField[row][field].img.setImageDrawable(GetPlayer());...
How would i create a gameBoard array with two []? (not sure what they are called.. :eek:)
Please explain more :confused:
- And with some code examples :-bd
I changed my sourcecode, how would i now check for a winner?
I have used arrays before, not just alot so you want me to do like this?:
int[] gameBoard;
gameBoard = new int[9];
And then:
gameBoard[0] = 1;
To show that the field has been taken by...
I am a little new to Java and haven't worked alot with arrays..
Please explain more and show some code :-)
I probably could, but i dont know how :o
Hello!
I am currently developing a little Tic Tac Toe game in Java (For Android)
And i am stuck, i want to "CheckForWinner();" but i can't really figure out how...
I am thinking something...