Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Sudoku puzzles are created in a 9x9 grid. Each row must contain each number 1-9. Each column must contain each number 1-9. Each row and

Sudoku puzzles are created in a 9x9 grid. Each row must contain each number 1-9. Each column must contain each number 1-9. Each row and column is divided in thirds to create 9 3x3 grids. o Each 3x3 grid must contain each number 1-9. If any of the above contain a duplicate number, the solution is invalid. Each puzzle may contain numbers and blank spaces o A blank space will be displayed as a space character The puzzles may not be solved o If the puzzle has spaces, the puzzle is not solved o Determine if the numbers given are part of a possible solution All array manipulation must be done using pointers. All pointer movement must be done using pointer arithmetic Any arrays used must be created dynamically. o Dynamic 2D arrays can be created with double pointers or created as a long single dimension array Comment your code generously. Refer to the grading rubric for more details. Use as few variables as possible. Dont waste memory holding a calculation just so you can print it out one time. User Interface: There will be no user interface for this program. All I/O will be file based. Input: All input will be in a file named puzzles.txt The file may contain multiple puzzles Each puzzle will be numbered The puzzles will be formatted as follows: o Puzzle number on a line by itself integer value o Sudoku puzzle 9 lines of numbers and spaces A space is not a delimiter A space just means there is no value in that block of the puzzle All numbers will be single digits (1-9) o Newline There may or may not be a newline after the last puzzle in the file Output: All output will be written to a file named solutions.txt. Create a table with three columns o Puzzle number o Valid/invalid/solved o Reason puzzle is invalid (if applicable) Example: column 2 has two 5s Example: Upper middle grid has two 7s A puzzle is solved if it is valid and there are no spaces in the puzzle Each puzzle validation will be listed on a separate line

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Explain the chemical properties of acids with examples.

Answered: 1 week ago

Question

Write the properties of Group theory.

Answered: 1 week ago