(Solved): HOMEWORK: Puzzle Reader This Will Lead Nicely Into A Sudoku-solving Problem, Which We Will Write Aft...
HOMEWORK: Puzzle Reader
This will lead nicely into a Sudoku-solving problem, which we will write after we cover recursion, in the next unit. For now, weâ€™ll just read and display the puzzles (which might be Sudoku or Numbrix or Magic Squares or any of several number-based puzzles).
S1 1 1 x 1 puzzle
S4: 1, 2, 3, and 4 4 x 4 puzzle
S9: 1 â€“ 9 9 x 9 puzzle (this is the â€œstandardâ€ Sudoku or Numbrix dimension)
S16: 0 â€“ F 16 x 16 puzzle; a base-16 or â€œhexâ€ puzzle
S25 0 â€“ P 25 x 25 puzzle; a base-25 puzzle
S36: 0 â€“ Z 36 x 36 puzzle; a base-36 puzzle
The only values allowed are the digits 0-9 and the chars A-Z / a-z. For the purposes of the homework, any value can be used in any puzzle. We consider only â€œsquareâ€ puzzles. Puzzles that have a number of entries that is a perfect square are processed and displayed; puzzles that do not have a number of entries that is a perfect square are rejected.
Your program is to read the puzzle (each cell is a single char), determine the number of entries, and if that number is a perfect square then display the puzzle as char, and display the puzzle as int. For example, the puzzle to the left would also be displayed as the puzzle to the right.
A 3 B 3 10 3 11 3
1 2 3 4 1 2 3 4
C A F E 12 10 15 14
0 8 2 C 0 8 2 12
This conversion of char to int will be of great use to us in the next unit, when we explore how recursion can be used to solve number puzzles such as Sudoku and Numbrix and Magic Square.
I needd the hold code please.