the problem has to do with the rotate method that doesn't update the shape...
do you know how i can fix this, because I don't know which method I have to change.
the problem has to do with the rotate method that doesn't update the shape...
do you know how i can fix this, because I don't know which method I have to change.
ok so the problem is in this:
public static boolean legalDown(int currentX, int currentY, int[][] board, int[][] shape)
{
int x = currentY+1;
int y = currentX;
//printArray(board);
if (x > 28)
{
return legalDownSpec(currentX, currentY, board, shape);
}
for (int row = 0; row < 4; row++)
{
for(int col = 0; col < 4; col++)
{
if (shape[row][col] == 1 && board[x+row][y+col] == 0)
{
}
else
{
if (shape[row][col] == 0 && board[x+row][y+col] == 1)
{
}
else
{
if (shape[row][col] ==0 && board[x+row][y+row] == 0)
{
}
else
{
System.out.println("NOT spec");
return false;
}
}
}
}
}
return true;
}
Can someone tell me how I can do this:
a = getContents();
b = board.getContents();
Inside of:
public static boolean legalDown(int currentX, int currentY, int[][] board, int[][] shape)
{
int x = currentY+1;
int y = currentX;
printArray(board);
if (x > 28)
{
return legalDownSpec(currentX, currentY, board, shape);
}
for (int row = 0; row < 4; row++)
{
for(int col = 0; col < 4; col++)
{
if (shape[row][col] == 1 && board[x+row][y+col] == 0)
{
}
else
{
if (shape[row][col] == 0 && board[x+row][y+col] == 1)
{
}
else
{
if (shape[row][col] ==0 && board[x+row][y+row] == 0)
{
}
else
{
System.out.println("NOT spec");
return false;
}
}
}
}
}
return true;
}