I need a JUnit test for this:
/**Shifts the column down by shift blocks, and fills in the top
of the column with grey blocks.
*/
private void shift(){
//Stores the location of the topmost non grey block in the current
column.
int columnTop = 0;
//Runs until the top most non grey block in the column is reached,
and then stores that value to the field columnTop. It requires that
the current button is not at the top of the column.
while((grid[columnTop][currentButtonWidth].getBackground() ==
Color.gray)){
columnTop = columnTop + 1;
}
//Shifts the colors down to cover the contiguous blocks. This
requires that the bottom most button of the same color as the
clicked button is not above the topmost colored block.
while(bottomButtonHeight >= columnTop){
grid[bottomButtonHeight][currentButtonWidth].setBackground(grid[currentButtonHeight-verticalShift][currentButtonWidth].getBackground());
bottomButtonHeight = bottomButtonHeight + 1;
}
}
We need at least 10 more requests to produce the answer.
0 / 10 have requested this problem solution
The more requests, the faster the answer.
I need a JUnit test for this: /**Shifts the column down by shift blocks, and fills...
could you please help me with this problem, also I
need a little text so I can understand how you solved the
problem?
import java.io.File; import java.util.Scanner; /** *
This program lists the files in a directory specified by * the
user. The user is asked to type in a directory name. * If the name
entered by the user is not a directory, a * message is printed and
the program ends. */ public class DirectoryList { public static...