Prevent illegal moves without crashing

Assignment Help C/C++ Programming
Reference no: EM13163367

working with 2D arrays. In the assignment, you will create a GUI version of the game Mini Sudoku.Mini Sudoku is a game played on a 6 x 6 grid of squares. At the beginning of the game, some of the squares are filled in with numbers, and the rest are blank. The object of the game is to place the numbers 1 to 6 on the board such that the following conditions hold Each row has the numbers 1 to 6

Each column has the numbers 1 to 6

Each group of 2 rows by 3 columns also has the numbers 1 to 6.

For example, a beginning configuration and solution to a Mini Sudoku board is as follows:

Beginning configuration

4 6 - 3 2 5

2 - 3 - - 6

6 2 4 5 - 1

3 - 5 4 - -

1 4 2 6 - -

- 3 - 2 1 -

Solution

4 6 1 3 2 5

2 5 3 1 4 6

6 2 4 5 3 1

3 1 5 4 6 2

1 4 2 6 5 3

5 3 6 2 1 4

Your goal is to write a program that will allow the user to try and solve mini-sudoku puzzles where the

initial configuration is specified in a text file.

Directions

1. Write an application using Swing that will allow a player to play mini-sudoku.

2. Your program must present the players with a graphical representation of the board of some kind, perhaps using JTextFields.

3. Your program must gracefully handle the case when a player tries to add a non-number to a square, or add a number that violates the Sudoku rules. It should prevent illegal moves without crashing.

4. When the game is over, the game must indicate that the game has been won.

5. The program must provide a menu to allow the user to load a file with an initial game configuration.

6. The program must provide a menu option to quit the program.

Reference no: EM13163367

Questions Cloud

Write a plausible chemical equation to interpret : write a plausible chemical equation to interpret at the atomic level what you observed in the reaction of Lysol Toilet Bowl Cleaner with 0.1 M AgNO3?
Explain a layer of peat beneath the glacial sediments : A layer of peat beneath the glacial sediments of the last ice age has a carbon-14/carbon-12 ratio that is 21.0% of that found in living organisms
Calculate the potential volume of the gas contained : Calculate the potential volume of the gas contained in 500-mL aerosol can when it is heated from 25 degrees C to 54 degrees C (approx. 130 degrees F) assuming a constant pressure.
How many grams of ammonium nitrate must have reacted : pure nitrogen can be prepared when an aqueous solution of ammonium nitrite decomposes to form water vapor and nitrogen gas. How many grams of ammonium nitrate must have reacted if 3.75dm3 of nitrogen gas was collected over water at 26C and 97.8 kP..
Prevent illegal moves without crashing : Your program must gracefully handle the case when a player tries to add a non-number to a square, or add a number that violates the Sudoku rules. It should prevent illegal moves without crashing.
How long will raw milk last in refrigeratior maintained : the activation energy for the reaction involved in the souring of raw milk is 75kj. milk will sour in about 8 hours at 21 degrees c. how long will raw milk last in refrigeratior maintained at 5 degrees c? assume rate constant to be inversely propo..
State what is the molar mass of the acid : what is the molar mass of the acid? If the standardization of the NaOH solution, why is it important to rinse the wet pipet with small portions of the standard oxalic acid solution
What masses of calcium sulfate and phosphoric acid : What masses of calcium sulfate and phosphoric acid can be produced from the reaction of 1.0 kg calcium phosphate with 1.0 kg concentrated sulfuric acid (98% H2SO4 by mass)?
How do compute the product distribution calculations : How do I calculate the product distribution calculations of the three peaks? Or the product ratios? The first peak was at 0.600, second at 0.95. Those are the retention times

Reviews

Write a Review

C/C++ Programming Questions & Answers

  An integer on this system is 4 bytes long

Assume the following for the program below. An integer on this system is 4 bytes long. The memory address where the array "a[]" was created begins at location 8000. a. #include

  Write a program to convert between rectangular

Write a program to convert between rectangular and cylindrical coordinates, based upon user input. For example, if the user wants to convert cylindrical to rectangular coordinates, the user would input r, ?, z values and the program would output x, y..

  Write a matrix multiplication program

Write a C++, matrix multiplication program which you can instrument to monitor and measure execution time as a function of problem size. Make sure it works in Microsoft Visual Studio.

  Write application which ask user to input grades of students

Write C++ application which asks user to input grades for 5 student (3 grades each) save them in five double one dimensional arrays (one array for each student),

  Write an input validation loop

write an input validation loop that asks the user to enter a number in the range of 1 through 4.

  Write program using c language to find page fault

Write program using c language to find page fault for individual processes, group of processes and system as whole using following system call int sys_pgfltstats(pid_t pid,int flag,pf_info_struct *info).

  Complete the design and implementation

Complete the design and implementation of the class customerType defined in the Programming Example Video Store. b. Design and implement the class customerListType to create and maintain a list of customers for the video store.

  Create class has three pieces of information as data members

Create a class called Date in C++ that includes three pieces of information as data members: month (type int), day (type int) and yaer (type int).

  Write a very basic doubly-linked list

CptS 122 Lab #2: Linked Lists ,  Along with vectors, linked lists are one of the fundamental data structures in computer science. Unlike vectors, which store information in a contiguous block of computer memory, linked lists have the potential to sto..

  Compute a program that calculates three resistance inputs

C language, compute a program that calculates three RESISTANCE inputs, and gives you the total resistance in OHMS. Like this, the total resistance is _____ ohms. These are three parallel circuits so the formula would be (1/R1 + 1/ R 2 +  1/ R 3 )  -1

  Prepare a program that uses at least two functions

Prepare a program that uses at least two functions that can be called from your main.

  The first will be a structure called point

Create two structures. The first will be a structure called Point and will have as its data members an x and y coordinate. The second will be called Line and will have two Point structures as its data members.

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