Question

I need a JUnit test for this: /**Shifts the column down by shift blocks, and fills...

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;  
}   
}

0 0
Add a comment Improve this question Transcribed image text
Request Professional Answer

Request Answer!

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.

Request! (Login Required)


All students who have requested the answer will be notified once they are available.
Know the answer?
Add Answer to:
I need a JUnit test for this: /**Shifts the column down by shift blocks, and fills...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
  • could you please help me with this problem, also I need a little text so I...

    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...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
Active Questions
ADVERTISEMENT