A Tic Tac Toe game!
HeadSucksAtLife (129)

In the comments, please rate it out of 10. Thanks you!

You are viewing a single comment. View All
HeadSucksAtLife (129)

I made if statements. Here's the code:
if ( (row[0].equals(row[0])&&row[0].equals(row[0]) && !row[0].equals("#")) ){
return Arrays.binarySearch(mark, row[0]);
}
if ( (row[0].equals(row[1])&&row[1].equals(row[2]) && !row[0].equals("#")) ){
return Arrays.binarySearch(mark, row[0]);
}
if ( (row[0].equals(row[1])&&row[1].equals(row[2]) && !row[0].equals("#")) ){
return Arrays.binarySearch(mark, row[0]);
}
if ( (row[1].equals(row[1])&&row[1].equals(row[1]) && !row[1].equals("#")) ){
return Arrays.binarySearch(mark, row[1]);
}
if ( (row[2].equals(row[1])&&row[1].equals(row[0]) && !row[2].equals("#")) ){
return Arrays.binarySearch(mark, row[2]);
}
if ( (row[2].equals(row[2])&&row[2].equals(row[2]) && !row[2].equals("#")) ){
return Arrays.binarySearch(mark, row[2]);
}
if ( (row[0].equals(row[1])&&row[1].equals(row[2]) && !row[0].equals("#")) ){
return Arrays.binarySearch(mark, row[0]);
}
if ( (row[0].equals(row[1])&&row[1].equals(row[2]) && !row[0].equals("#")) ){
return Arrays.binarySearch(mark, row[0]);
}
return -1;
}
}
Thanks for the feedback!
@Coder100