Latin squares - puzzle

Assignment Help JAVA Programming
Reference no: EM13552177

Latin squares is a puzzle that is played on a square grid of squares. The purpose of the puzzle is to enter a digit in each square in such a way that no row contains any duplicates and no columns contain duplicates. For example, in a 3 by 3 grid using the digits 1, 2 and 3, the following is a sample Latin square solution.

Of course, this is not the only possible solution for a 3 by 3 Latin square.

For this program, the user is presented with a GUI like the one to the right. The top row of six text fields allow the user to specify the six symbols to be used in the Latin square. The user is expected to enter six different symbols in these fields. (In the sample the p, i, g, l, e , t
characters are shown.) The 6 by 6 grid of text fields is for two purposes: (1) to allow the user to restrict the puzzle by entering characters (2) for your program to complete a solution by filling in the empty fields.

1389_Puzzle.png

A class called LatinSquareGUI is supplied to create an interact with this window. You will need to supply the buttons. The top[ two buttons are required for a 20-point program.

Clicking the Clear button causes the 6 by 6 grid to be cleared to all empty.

Clicking the Solve button causes the program to display a single solution by using only the symbols from the top row of six text fields in such a way that the non-empty grid symbols are not altered. If a solution exists, the gird must be updated to display this solution. If no solution is possible, then the grid remains unaltered.

Add the third button as shown above. In this case the Solve button does not display the solution, but rather it prints a message (to the right of the Solve button). This message indicates how many different solutions are possible for the Latin square given the constraints. Clicking the Display Solution button causes one of the solutions found by the most recent Solve click to be displayed.

Reference no: EM13552177

Questions Cloud

Provide a rationale for your response. : Provide a rationale for your response.
Determine both the reflectance and transmittance : Light in air is incident perpendicularly on a sheet of crown glass having an index of refraction of 1.522. Determine both the reflectance and transmittance
Define a particular brand of gasoline has a density : A particular brand of gasoline has a density of 0.737 g/mL at 25 c how many grams of this gasoline would fill a 12.4 gal tank
Estimate what is the rockets thrust : A rocket, which is in deep space and initially at rest relative to an inertial reference frame, has a mass of 53.1 x 10^5 kg, of which 3.81 x 10^5 kg is fuel. What is the rocket's thrust
Latin squares - puzzle : Solve button causes the program to display a single solution by using only the symbols from the top row of six text fields in such a way that the non-empty grid symbols are not altered.
Evaluate the rms voltage of the source : A source delivers an AC voltage of the form ?v = 98.0 sin (80?t), where ?v is in volts and t is in seconds, to a capacitor. The maximum current in the circuit is 0.500 A. Find the rms voltage of the source
An organic juicing company with retail stores : An organic juicing company with retail stores and is also the manufacturer and distribution company in San Antonio, Texas.
Calculate how much charge flows through the light bulb : A 12 V battery (which has an electric potential difference of 12 V between its terminals) is connected to a 10 W light bulb for 1 second. Calculate how much charge flows through the light bulb in the 1 second.
Explain how many covalent bonds with other atoms : How many covalent bonds with other atoms will a sulfur atom with 6 electrons in it's outer shell most likely make, and why

Reviews

Write a Review

JAVA Programming Questions & Answers

  Develop class which implements interface

Let the ADT called SquareMatrix. (The matrix can be represented by 2-D array of ints w/ n rows and n columns.) Write specification for ADT as Java interface. Develop the class which implements interface.

  Write a program to simulate the behavior of the philosophers

Write a program to simulate the behavior of the philosophers, where each philosopher is a thread and the chopsticks are shared objects.

  Java application prompt user to put in integer from keyboard

Write a java application that performs the following task: prompt user to put in an integer from the keyboard, search for the user input from the array created in step 1.

  Define an adt for character strings.

Define an ADT for character strings. Your ADT should consist of typical functions that can be performed on strings, with each function defined in terms of its input and output. Then define two different physical representations for strings.

  Write an application that uses an array

Write an application that uses an Array to store 10 messages of type String. You will store this Array with 10 messages of your choosing.

  Create a project in eclipse

Create a new project

  Implement a shopping cart class with user interface

project will be to implement a shopping cart class with user interface (UI) that contains main() in Net Beans. The UI class will be used to perform user input/output and to invoke the appropriate methods of shopping cart class. When your program star..

  Simulate some people catching fish in a lake in java program

In this project, you will simulate some people catching fish in a lake. The purpose of the assignment is to get used to using Arrays as well as getting more experience in having objects interact together.

  Write and describe the definition of what composition is

write and explain the definition of what composition is and how it is useful in writing an object-oriented program.

  Your project as a programming consultant is to create a

your project as a programming consultant is to create a program that develops an amortization schedule.nbsp your

  Driveway is a "last-in, first-out" stack. of course

Driveway is a "last-in, first-out" stack. Of course, when a car owner retrieves a vehicle that wasn't the last one in, the cars blocking it must temporarily move to the street so that the requested vehicle can leave. Write a program in Java that m..

  Web application that allows user to specify six lottery nums

Write a web application that allows a user to specify six lottery numbers. Generate your own combination on the server, and then print out both combinations together with a count of matches.

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