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

  Each of the conditional jump statements causes a jump to des

Assume for each part of this problem that the EAX register contains 00 00 00 4F and the doubleword referenced by value contains FF FF FF 38.

  Evaluate issues and challenges associated with integration

Evaluate the issues and challenges associated with information technology integration and summarize the competitive advantage that information technology affords to organizations.

  Write a method named maxelement

Write a method named maxElement, which returns the largest value in an array that is passed as an argument. The method should use recursion to find the largest element. Demonstrate the method in a program.

  Identify the advantages and disadvantages of using word

Identify the advantages and disadvantages of using Word to work with graphics, tables, and special formatting functionality. Provide specific examples. Create a list of "Word Best Practices" to keep in mind when using Word or other word documen..

  Variety of information gathering methods available

There are a variety of information gathering methods available to assist in the determination of system requirements. If you were in charge of developing a system to automate medical records in a hospital.

  Ability to apply the concepts

The goal of this project is for you to demonstrate your ability to apply the concepts

  What is a predefined control event

What is a predefined control event? Discuss its usage in programming

  In order to create a unique field in a table in a database

1. in order to create a unique field in a table in a database you need to define a .viewprimary keyhost keyjoin2.a in

  Explain traffic control devices to alert drivers

Are all intersections located safely with respect to horizontal and vertical alignment? Where intersections happen at end of high-speed environments (e.g., at approaches to towns); are there traffic control devices to alert drivers?

  Create a boardroom-quality presentation

Develop a local area network plan for Taylor & Sons Financial Consulting, including the layout of the network, user and group access, and security. Create a boardroom-quality Microsoft® PowerPoint® presentation of 10-12 slides detailing your plan.

  Explain how the report structure and organization help

Explain how the report structure and organization could help the overall recovery efforts in a disaster, and determine whether or not you believe the organization of large plans is a key consideration for plan creators and management.

  Write a program that prompts the user to enter the accounts

The program should pass these values to a function that returns the future value of the account after the specified number of months. The program should display the accounts future value.

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