The Sudoku is a simple visual game in which you need to be able to fulfill tiles not repeating values that must be uniqu

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

The Sudoku is a simple visual game in which you need to be able to fulfill tiles not repeating values that must be uniqu

Post by answerhappygod »

The Sudoku is a simple visual game in which you need to be ableto fulfill tiles not repeating values that must be unique in therow, column or grid. Some references for this game can be foundeasily on the internet. For instance, you can play an interestingversion using the following site: https://www.websudoku.com/
❖ In short, each row, column or grid indicates a sequence ofnumbers that are varying from a range using different chars2 .
❖ The game must have two modes: “design” and “play”, where youcan respectively, create and starting playing the game.
➢ In the design mode, the initial board is completely “blank”and the user must consider the logic to be able to selectappropriately the correct distribution of values in the tiles.
▪ In this case, when the game is complete (respecting therules), it should be possible to hide this solution – to be usedlater as a valid game configuration.
➢ In the play mode, depending on the difficulty level (ex:“easy”, “medium” or “hard”), some data (tile values) are shown, butsome will be hidden.
▪ The problem is that in this second mode, the player mustremember to select / type the values of the tile respecting therules of the game.
• If the player is selecting a correct value (not repeated inrow, nor column, neither grid), he/she is increasing his/herpunctuation. If not, the points will be decremented.
Class GameController The class GameController will assemble theUI, primarily in its default constructor. You can consider it as aninner class called Controller. You will use it to manage the visualcomponents. The Controller class will have very basic code. Itreads the action command (or JavaFX equivalent) and will developthe Sudoku in the two different modes above described (“design” or“play”). When one value is selected, a logic function will beinvoked to check if it is ok and will let it be included in theconfiguration.
Some basic behaviors:
❖ All components must have a unique action command, but the waythat you can select the mode as well as the strategy to be used inthe game can vary freely. For example:
➢ You can use menus or choices or dialogs to define the modeinitially.
➢ The Sudoku itself can be composed by buttons, or labels, ortext fields.
❖ Some notes: • NOTE 1:
o If you are using Swing, GameController should extend JFrame.You may have to define your JFrame parameters in GameControllerinstead of the Sudoku class.
o If you are using JavaFX, GameController may extend Scene, Paneor any descended Pane subclass as you see fit.
The Game must let you perform some actions:
• Select the mode: “Design” or “Play”.
• Define the dimension: This value can vary according to onespecific range (ex: 2 to 4). Remember, that it means that theinterface must be dynamically configured. Sudoku in differentsquare configurations (dim=2, dim=3 and dim=4) • Show/Hide: Usingthis control, you can exhibit the complete solution (created bydesign) or hide it to start the game3 .
• Difficulty level: Where you are supposed to define differentways to show/hide data from the current game configuration. Theapproach suggested is: o Random configuration: Use random numbersto evaluate if one specific tile is supposed to show or hide itsvalue. Ex: consider these probabilities:
▪ Easy difficulty: About 25% of data is hidden; ▪ Mediumdifficulty: About 50% of data is hidden;
▪ Hard difficulty: About 75% of data is hidden. • Additionalelements: Your interface must also contain: o Image logo: Smallbutton with image that can open a dialog with “About” message.
o Points: Showing the points at this moment.
o History Area (not mandatory): To describe the sequence ofactions performed by the user. In the future, you need to be ableto persist the solution in one specific file (that can also beloaded by any player) using one specific configuration – that willcompose the model to be used in the MVC solution.
o Time: To show the number of seconds since the beginning ofgame (to be implemented later).
o Reset button: To restart the game.
1.4.2. Initial Behavior Once selected the Design mode, the usermust be able to define a correct configuration for Sudoku.
❖ It means that you must let the user to create anyconfiguration in the game respecting the rules:
➢ Do not let the user to include invalid values and/or repeatedvalues.
➢ When you finish this configuration, let the player save it forfuture execution4 .
➢ Optionally, while an action is performed, if you have a panel(“history area”), you can provide additional info about what ishappening Ex: … Tile(0,2) selected; New configuration:2,23414123321_1432 … We have general restrictions:
• All classes must belong to one specific package (“sudoku”).Remember that right now, your configuration can be saved in thememory using and “pattern” that you can use.
• TIP: This layout uses Java’s default look and feel. • Theframe (or stage) must not be resizable.
• Your name / team name must appear in the title bar. • You mayuse BorderLayout, FlowLayout and GridLayout (or the JavaFXequivalent).
• This UI must be assembled manually.
o The use of UI builders is not permitted this time and willimply in deductions
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply