In: Computer Science
What is a Test Case? Write the Test cases for a 4X4 queen’s problem.
Test cases are different sets of inputs used to find the correctness of your program.
Like if your program is to print numbers till user input.Then the user inputs 1,4,5,6 or anything is a test case because it is testing your program against these inputs.
A 4*4 queen;s problem is a problem where we need to place 4 queens in a 4*4 crossboard such that no two queens attack each other.
So basically its the arrangement of queens we need to do
1- 0 0 1 0 1 0 0 0 0 0 0 1 0 1 0 0 2- 0 1 0 0 0 0 0 1 1 0 0 0 0 0 1 0
3- 0 0 1 0 1 0 0 0 0 0 0 1 0 1 0 0 4- 0 1 0 0 0 0 0 1 1 0 0 0 0 0 1 0
These are the arrangements for 4*4 queens problem . Just check if the matrix printed by the coder is one of the 4 mentioned above matrices.
If yes then show test cases passed
else show your code is incorrect.
Hope you like the solution.
please do thumbs up!