This program will read in a text file (redirected to stdin) containing values on a 9 x 9 sudoku grid. The text file have 9 printable characters on a line, each separated by a space with 9 such lines in the file. Each of these characters will represent a value on the sudoku grid at a particular position. There are 9 possible values that be filled in at a particular position: the digits '1' through '9'. In addition an unsolved sudoku will have blank positions on the grid: in the file these will be represented by the _' (underscore) character. Using the data from the file, the program will display the sudoku grid and determine whether or not the sudo grid is valid. In order for a sudoku grid to be valid there are three rules: 1. No particular digit value may occur more than once in any row 2. No particular digit value may occur more than once in any column No particular digit value may occur more than once in any 3x3 subgrid 3. 5. 333 3 33 3 5. 555

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Hello! Can you do this assignment in C language?

1. Overview
The purpose of this assignment is to give you some experience using arrays and functions in addition to loops &
conditionals, as well as printf & scanf, declaring variables, and using logical expressions.
2. More Assignment Specifics
This program will read in a text file (redirected to stdin) containing values on a 9 x 9 sudoku grid. The text file will
have 9 printable characters on a line, each separated by a space with 9 such lines in the file. Each of these
characters will represent a value on the sudoku grid at a particular position. There are 9 possible values that can
be filled in at a particular position: the digits '1' through '9'. In addition an unsolved sudoku will have blank
positions on the grid: in the file these will be represented by the _' (underscore) character.
Using the data from the file, the program will display the sudoku grid and determine whether or not the sudoku
grid is valid. In order for a sudoku grid to be valid there are three rules:
1. No particular digit value may occur more than once in any row
2. No particular digit value may occur more than once in any column
3. No particular digit value may occur more than once in any 3x3 subgrid
5
333
333
33 3 333 3 33
|555
555555555
|555
| 1 1 1
1 11
1 1 1|1|1|1|1 1 1|
3.
Unlike the digit values '1' through '9', there may be multiple blank positions ('_') in any row, column or 3x3
subgrid. For an unsolved sudoku containing any number of blank positions it is not necessary to evaluate whether
the sudoku is solvable given the provided numbers, the program will only need to determine that every position
with a number follows the three above rules to determine if the 9x9 grid is valid.
Finally, the program should be divided into functions. Using multiple functions instead of having the entire
program in main() helps divide the program into more manageable parts and will also allow you to work on the
program incrementally as well as facilitate the testing and debugging of any specific section of the program.
Additionally functions can reduce the duplication of code within a program. It is up to you how to organize the
program (one function for input, another for calculations, etc.) but a good rule of thumb is that you should be able
to see the entire code of any function in your program on the screen without scrolling.
3. Note about input redirection
To redirect stdin to read from a file (for example "inputFile.txt") instead of reading whatever the user types in, run
the program with the following command (assuming the program binary is named "main"):
/main < inputFile.txt
Transcribed Image Text:1. Overview The purpose of this assignment is to give you some experience using arrays and functions in addition to loops & conditionals, as well as printf & scanf, declaring variables, and using logical expressions. 2. More Assignment Specifics This program will read in a text file (redirected to stdin) containing values on a 9 x 9 sudoku grid. The text file will have 9 printable characters on a line, each separated by a space with 9 such lines in the file. Each of these characters will represent a value on the sudoku grid at a particular position. There are 9 possible values that can be filled in at a particular position: the digits '1' through '9'. In addition an unsolved sudoku will have blank positions on the grid: in the file these will be represented by the _' (underscore) character. Using the data from the file, the program will display the sudoku grid and determine whether or not the sudoku grid is valid. In order for a sudoku grid to be valid there are three rules: 1. No particular digit value may occur more than once in any row 2. No particular digit value may occur more than once in any column 3. No particular digit value may occur more than once in any 3x3 subgrid 5 333 333 33 3 333 3 33 |555 555555555 |555 | 1 1 1 1 11 1 1 1|1|1|1|1 1 1| 3. Unlike the digit values '1' through '9', there may be multiple blank positions ('_') in any row, column or 3x3 subgrid. For an unsolved sudoku containing any number of blank positions it is not necessary to evaluate whether the sudoku is solvable given the provided numbers, the program will only need to determine that every position with a number follows the three above rules to determine if the 9x9 grid is valid. Finally, the program should be divided into functions. Using multiple functions instead of having the entire program in main() helps divide the program into more manageable parts and will also allow you to work on the program incrementally as well as facilitate the testing and debugging of any specific section of the program. Additionally functions can reduce the duplication of code within a program. It is up to you how to organize the program (one function for input, another for calculations, etc.) but a good rule of thumb is that you should be able to see the entire code of any function in your program on the screen without scrolling. 3. Note about input redirection To redirect stdin to read from a file (for example "inputFile.txt") instead of reading whatever the user types in, run the program with the following command (assuming the program binary is named "main"): /main < inputFile.txt
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY