subject

Code works, need help writing header file. /**
*
* TODO -- Add method header comments
*/
public static boolean isWinningCoord(int x, int y, int[][] b, int z) {
if(x >= BOARD_HEIGHT || x = BOARD_WIDTH || y 0 && b[x - 1][y] == -1)) {
return false;
}
{ // Vertical
int count = 0;
for(int i = x - 1; i >= 0; i--) {
if(b[i][y] != z) {
break;
} else {
count++;
}
}
if(count >= CONNECT_WIN - 1) {
return true;
}
}
{ // Horizontal
int count = 0;
for(int i = y - 1; i >= 0; i--) {
if(b[x][i] != z) {
break;
} else {
count++;
}
}
for(int i = y + 1; i = CONNECT_WIN - 1) {
return true;
}
}
{ // Diagonals
int countNegSlope = 0;
for(int i = x + 1; i = 0; j--){
if(b[i][j] != z) {
break;
} else {
countNegSlope++;
}
}
}
for(int i = x - 1; i >= 0; i--){
for(int j = y + 1; j = CONNECT_WIN - 1) {
return true;
}
int countPosSlope = 0;
for(int i = x + 1; i = 0; i--){
for(int j = y - 1; j >= 0; j--){
if(b[i][j] != z) {
break;
} else {
countPosSlope++;
}
}
}
if(countPosSlope >= CONNECT_WIN - 1) {
return true;
}

}
return false;
}

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 23:00
Suppose s, t, and w are strings that have already been created inside main. write a statement or statements, to be added to main, that will determine if the lengths of the three strings are in order by length, smallest to largest. that is, your code should determine if s is strictly shorter than t, and if t is strictly shorter than w. if these conditions hold your code should print (the boolean value) true. if not, your code should print false. (strictly means: no ties) example: if s, t, and w are "cat", "hats", and "skies" your code should print true - their lengths are 3-4-5; but if s, t, and w are "cats" "shirt", and "trust", then print false - their lengths are 4-5-5 enter your code in the box below
Answers: 2
question
Computers and Technology, 24.06.2019 14:00
In the microsoft® access® and microsoft excel® programs, the ribbon contains tabs that are divided into with like tools in them. parts groups containers bunches
Answers: 1
question
Computers and Technology, 25.06.2019 04:00
Has anyone noticed that has been giving the wrong answers and that the ads are blocking answers or is that just me?
Answers: 2
question
Computers and Technology, 25.06.2019 12:30
Why is outfitting a workspace with video games in technology development company considered a strategic use of money
Answers: 2
You know the right answer?
Code works, need help writing header file. /**
*
* TODO -- Add method header comments<...
Questions
Questions on the website: 13722360