Verify the correctness of the board content

Assignment Help Basic Computer Science
Reference no: EM13781407

The mission of this assignment is to implement a "Sudoku game board" and interact with user using a small set of commands that enable to initialize the game board. You program must permit user to see the game board, swap rows, columns, or areas of the board for randomization, verify the correctness of the board content, and erase values of the generated game board.

User can enter the following show, swap, verify, erase, and quit command:

• show will display the board content

• swap will exchange some randomly generated row/column position with another row/column position - note that a simple swap only occurs within a permissible range (see example below)

• verify will check all the consistencies enforced for the Sudoku game and print out which places are wrong

• erase will pick up a random cell of the Sudoku board and place that cell as '-' mark visible to user

• quit will stop execution

• other input must show an error message and ask to reenter a correct command
Implementation requires you to utilize a structure holding "vector<vector<short>>" to represent the 9 x 9 game board. The main program is a mere loop to dispatch the execution of each read command. This submission will be somewhat equivalent to the midterm exam of this course work. There will be no extension of due as in the previous assignments.

The next example tells what are required to realize:
Welcome Sudoku Initializer!
>show
A B C D E F G H I
P 2 3 4 8 9 1 5 6 7
Q 5 6 7 2 3 4 8 9 1
R 8 9 1 5 6 7 2 3 4
S 3 4 5 9 1 2 6 7 8
T 6 7 8 3 4 5 9 1 2
U 9 1 2 6 7 8 3 4 5
V 1 2 3 7 8 9 4 5 6
W 4 5 6 1 2 3 7 8 9
X 7 8 9 4 5 6 1 2 3
> swap
Trying to swap rows Q and S...
- Rows P and S were swapped...
- Rows Q and T were swapped...
- Rows R and U were swapped...
>show
A B C D E F G H I
P 3 4 5 9 1 2 6 7 8
Q 6 7 8 3 4 5 9 1 2
R 9 1 2 6 7 8 3 4 5
S 2 3 4 8 9 1 5 6 7
T 5 6 7 2 3 4 8 9 1
U 8 9 1 5 6 7 2 3 4
V 1 2 3 7 8 9 4 5 6
W 4 5 6 1 2 3 7 8 9
X 7 8 9 4 5 6 1 2 3
> swap
Trying to swap columns H and G...
- Columns H and G were swapped...
>show
A B C D E F G H I
P 3 4 5 9 1 2 7 6 8
Q 6 7 8 3 4 5 1 9 2
R 9 1 2 6 7 8 4 3 5
S 2 3 4 8 9 1 6 5 7
T 5 6 7 2 3 4 9 8 1
U 8 9 1 5 6 7 3 2 4
V 1 2 3 7 8 9 5 4 6
W 4 5 6 1 2 3 8 7 9
X 7 8 9 4 5 6 2 1 3
> verify
- All columns, rows, and components are OK...
> erase
Erasing row P column F
> erase
Erasing row X column A
>show
A B C D E F G H I
P 3 4 5 9 1 - 7 6 8
Q 6 7 8 3 4 5 1 9 2
R 9 1 2 6 7 8 4 3 5
S 2 3 4 8 9 1 6 5 7
T 5 6 7 2 3 4 9 8 1
U 8 9 1 5 6 7 3 2 4
V 1 2 3 7 8 9 5 4 6
W 4 5 6 1 2 3 8 7 9
X - 8 9 4 5 6 2 1 3
> verify
- Found inconsistency in row P...
- Found inconsistency in row X...
- Found inconsistency in column A...
- Found inconsistency in column F...
- Found insonsistency in component starting at row P and column D...
- Found insonsistency in component starting at row V and column A...
> quit
Bye...

Reference no: EM13781407

Questions Cloud

Describe the types of cost-based pricing : Name and describe the types of costs marketers must consider when setting prices. Describe the types of cost-based pricing and the methods of implementing both. Provide examples and a breakeven analysis for a product you are familiar with. If possibl..
Marketing department of a high-end department : Assume you work in a marketing department of a high-end department store. You send out Thank You cards with a short customer satisfaction survey one week after purchase. You wonder if survey response rates would increase significantly from your curre..
Write a program that performs boolean expressions : Read in a month and determine the number of days in the month. If the month is February, prompt the user for a year and determine if the year is a leap year to output the correct number of days.
Write the program vb text as a model : the VB text as a model and write the program so that each group is invisible and becomes visible only when its corresponding check box is checked. After the button is clicked, the amount of the bill should be calculated. NOTE: FIGURE 4.62 IS A DIF..
Verify the correctness of the board content : The mission of this assignment is to implement a "Sudoku game board" and interact with user using a small set of commands that enable to initialize the game board. You program must permit user to see the game board, swap rows,
Create an interface that has two list boxes : Create an interface that has 2 list boxes for i) the weekly hours worked (containing integer values from 35 to 45 inclusive) and ii) the hourly rate of pay (from 9.50 to 14.00 inclusive, in increments of 0.50).
Development and characteristics of abstract expressionism : Discuss the development and characteristics of Abstract Expressionism; be sure to include Gorky, Pollock, and de Kooning in your discussion, using examples of their work as discussed in the text.
Complaints of subordinates regarding delegation : Discuss why one of the major complaints of subordinates regarding delegation is the issue of dumping. Offer an example of a personal experience or observation of dumping taking place.
Create a form to register a user to an online store : Create a form to register a user to an online store. User must create a username and password. These are required and the password must not be shown in clear text. Password should include a way to confirm password.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd