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 17:40
Gabe wants to move text from one document to another document. he should copy the text, paste the text, and open the new document highlight the text, select the cut command, move to the new document, make sure the cursor is in the correct location, and select the paste command select the save as command, navigate to the new document, and click save highlight the text, open the new document, and press ctrl and v
Answers: 1
question
Computers and Technology, 23.06.2019 10:50
Your friend kayla is starting her own business and asks you whether she should set it up as a p2p network or as a client-server network. list three questions you might ask to kayla decide which network to use and how her answers to those questions would affect your recommendation.
Answers: 2
question
Computers and Technology, 24.06.2019 01:30
Hazel has just finished adding pictures to her holiday newsletter. she decides to crop an image. what is cropping an image?
Answers: 1
question
Computers and Technology, 24.06.2019 09:40
Healthy study habits are best described as
Answers: 1
You know the right answer?
Code works, need help writing header file. /**
*
* TODO -- Add method header comments<...
Questions
question
Mathematics, 05.02.2021 17:40
question
Mathematics, 05.02.2021 17:40
question
Mathematics, 05.02.2021 17:40
question
Mathematics, 05.02.2021 17:40
question
Mathematics, 05.02.2021 17:40
Questions on the website: 13722363