Have a Question ?

Home / Answered Questions / Other / homework-puzzle-reader-this-will-lead-nicely-into-a-sudoku-solving-problem-which-we-will-write-after-aw730

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

"advance Java"

I needd the hold code please.

We have an Answer from Expert View Expert Answer

Expert Answer

We have to read every char and keep into char array. Then need to check the length of char array and check mod of length as 0 or not.if mod of length is 0 the we have to display the puzzle as charan
We have an Answer from Expert
Buy This Answer $6

-- OR --

Subscribe To View Unlimited Answers
Subscribe $20 / Month