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...
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.
|