This program is supposed to return the location of a piece on a board.The board is being represented as a 2D array. The loop simply cycles through the columns and then if the piece is still not found it goes to the next row. However,only the [-1,-1] array is being returned( no pieces are being found). I have not been able to find the error on my own, so any help
public int[] pieceFinder(int piece) {
int[][] board={{43,44,45,50,47,48,49},
{36,37,38,39,40,41,42},
{29,30,31,32,33,34,35},
{22,23,24,25,26,27,28},
{15,16,17,18,19,20,21},
{8,9,10,11,12,13,14},
{1,2,3,50,5,6,7}};
int row=0;
boolean found=false;
int[] location={-1,-1} ;
for(int column=0;found==true;column++) {
if(board[row][column]==piece) {
found=true ;
location[0]=row;
location[1]=column;
}
else if(column==6) {
if(row==6) {
break;
}
else {
row++;
}
}
return location;
}