/Backtracking-using-C

The same N colors are placed in a different order in each row on the game board, which looks like an NxN matrix. The order of the colors in a row can be changed by shifting the colors to the right. For example, if the colors in the row are red, blue, green, purple, then the row is shifted to the right once, and the new order becomes purple, red, blue, green. If it is moved to the right one more time, green, purple, red and blue are obtained. This C program recursively arranges the rows with backtracking method so that there is only 1 of each color in each column in the result matrix.

Primary LanguageC

Backtracking-using-C

The same N colors are placed in a different order in each row on the game board, which looks like an NxN matrix. The order of the colors in a row can be changed by shifting the colors to the right. For example, if the colors in the row are red, blue, green, purple, then the row is shifted to the right once, and the new order becomes purple, red, blue, green. If it is moved to the right one more time, green, purple, red and blue are obtained. This C program recursively arranges the rows with backtracking method so that there is only 1 of each color in each column in the result matrix.

  1. Colors are RED, BLUE, GREEN, BLACK, YELLOW, ORANGE, WHITE, and PINK.
  2. Get number N which should be between 3 and 8, and color matrix from user.
  3. The program should be 2 types of outputs. If the input matrix is not able to be solved, print a message about that. If there is a solution, print the middle forms of the matrix.

SCREENSHOTS
1
3

2
1

3
2