Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please write program in C. 2. The game of Sudoku is played on a 9 9 grid in which entries consist of the numbers 1

Please write program in C.

image text in transcribed

2. The game of Sudoku is played on a 9 9 grid in which entries consist of the numbers 1 thru 9. Initially, the board is presented with some values filled in and others blank. The player has to fill in the remaining values until all grid boxes are filled and the following constraints are satisfied . In each of the 9 rows, each number, 1-9 must appear exactly once . In each of the 9 columns, each number 1-9 must appear exactly once . In each of the 3 x 3 subgrids, each number 1-9 must appear exactly once A full example is presented in Figure 1 83 54 1 6 9 27 29 685 7 43 1 4172 9 3 6 5 8 5 6 913 4 782 12 3678 5 4 9 7485 29 163 6 5 278 1 3 94 9813 4 5276 37496 2 8 15 Figure 1: A solved Sudoku puzzle In this exercise, you will read in an input file containing a possible sudoku solution and determine if it is a valid or invalid solution. The file will have the following format it will contain 9 lines with 9 numbers on each line delimited by a single space. If the input represents a valid solution, output " Valid Solution", otherwise output at least one reason why the input is not a valid solution Have your program accept the file name to be read in as a command line argument. Output the results to the standard output. 2. The game of Sudoku is played on a 9 9 grid in which entries consist of the numbers 1 thru 9. Initially, the board is presented with some values filled in and others blank. The player has to fill in the remaining values until all grid boxes are filled and the following constraints are satisfied . In each of the 9 rows, each number, 1-9 must appear exactly once . In each of the 9 columns, each number 1-9 must appear exactly once . In each of the 3 x 3 subgrids, each number 1-9 must appear exactly once A full example is presented in Figure 1 83 54 1 6 9 27 29 685 7 43 1 4172 9 3 6 5 8 5 6 913 4 782 12 3678 5 4 9 7485 29 163 6 5 278 1 3 94 9813 4 5276 37496 2 8 15 Figure 1: A solved Sudoku puzzle In this exercise, you will read in an input file containing a possible sudoku solution and determine if it is a valid or invalid solution. The file will have the following format it will contain 9 lines with 9 numbers on each line delimited by a single space. If the input represents a valid solution, output " Valid Solution", otherwise output at least one reason why the input is not a valid solution Have your program accept the file name to be read in as a command line argument. Output the results to the standard output

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

Recommended Textbook for

Oracle 10g Database Administrator Implementation And Administration

Authors: Gavin Powell, Carol McCullough Dieter

2nd Edition

1418836656, 9781418836658

More Books

Students also viewed these Databases questions