Use Java language ONLY
Mastermind is a code-breaking game between two players, the codemaker (in this case the computer) and the codebreaker (the player).
How to Play
See the following video https://www.youtube.com/watch?v=XwuwWTH39ac.
Project Requirements
The goal of the project is to implement a text-based/menu-driven Mastermind game.
The game will include a menu from which the user will choose:
- See Rules
- Play Game
- See Highest Score
- Quit
- When the user chooses to play a game, the computer will generate a three-position code using five colors (Red/Blue/White/Yellow/Green).
The player will try to break the code by choosing a color for each of the three positions available - color repeats are allowed. Example: R G B (Red-Green-Blue)
The computer will provide feedback using three pins (one for each color) placed in non-related order:
-
- Red Pin (R)– A color is part of the code and has been placed on the right position.
- White Pin(W) – A color is part of the code but has been placed on the wrong position.
- No Pin (O)– The color is incorrect.
The game ends when either:
-
- The player wins. Breaks the code – three colors on the exact positions as initially generated by the computer. The player’s score is the round when the code was broken (1-10).
- The player loses. No code is broken after ten attempts. No score is awarded.
- Example
Assume the computer has generated the following code:
R G B
A possible output at the end of the second round could be:
Colors Pins
R R R R O O
R B Y R W O
- At the end of each game, the system will read in the score stored in “highscore.txt”.
- If the file does not exist, it will create one with the current player as the high score (name & score).
- If the user has scored higher than the value in the file, it will replace the text file with the current player’s name and score.
- Otherwise, the text file will remain intact.
- The user should be able to play as many times as he/she wishes.
Notes about Functionality, Implementation & Program Requirements:
- The program should validate the information entered by the user and display the appropriate error messages.
- The code should be self-documented, including:
-
-
- Descriptive Comment indicating
- Author
- Program Summary
- IPO Chart
- Appropriate comments throughout the code that highlight, among other things, the implementation of the
algorithm . - Adequate use of spaces and indentation so the source code is easy to read when printed out.
- Descriptive Comment indicating
- Functional decomposition implementation of the algorithm. Must define at least four different functions. Make sure to include functions that exemplify void vs. return-type, and value vs. reference parameters.
- Two-Dimensional array implementation. The mastermind color & pin boards must be implemented using parallel two-dimensional arrays.
-
Grading Rubric
Documentation & Algorithm (5) ______
Menu-Driven interface (10) ______
- Option driving
- Looping
See Rules (5) ______
Game Implementation (25) ______
- Generate code
Random function seeding & color generation - Prompt player for guess
- Provide feedback
- Determine win/lose
- Loop up to ten rounds
Array Implementation (20) ______
- Two-Dimensional Arrays
- Parallel Arrays
File Manipulation (20) ______
- See highest score
- Create/Update highscore.txt
Functional Decomposition (20) ______
- Methods
Game Interface (5) ______
- Add you own creativity
Total (110/100)
Trending nowThis is a popular solution!
Step by stepSolved in 5 steps with 3 images
- OpenGL Programming Help Write a program that creates a 3d captial "i" that animates using a display list. In response to the menu selection, 1.spin the "I" vertically 2. stop spinning When the user clicks on the right mouse button and selects the menu option to spin the "I" it should spin in the letter.arrow_forwardIT architecture: what's a "complete solution"?arrow_forwardCreate a new “GoodJob” project. Run Visual Studio and select C# Windows Application. When you first start a C# project you must name your Project. You cannot name your project after you create it. You must name git when you first begin. So, call this first project “GoodJob”. Now you should see an empty GUI window show up. This GUI window is called the Designer Window. Your Toolbox should be to the left and your properties window should be to the right of this Designer window. If you need help getting started with Visual Studio, (Study chap. 1 of your textbook / PP slides), plus the Yutube links, it shows you how to start a new Project and start adding components. We are going to add 3 components to this Project. A Label and 2 Buttons. The Label should say “Hello World” and the Buttons should say “GoodJob” and “Exit”. The Label should be near the top in the center and the Buttons should be near the bottom in the center. Make sure to give these components names by using the…arrow_forward
- Do this in JAVA Programmingarrow_forwardA drawing environment in which menus, toolbars, pallets, and ribbon panels are displayed for a specific task is called a: a. taskabar b. drawing editor c. workspace d. Propertoies panel e. environmental task panearrow_forwardDesign the wireframes and storyboard, interactivity diagram, object dictionary, and any necessary scripts for an interactive program for customers of the Dharma Day Spa. Allow customers the option of choosing a manicure ($10), pedicure ($25), or both ($32). After the customer clicks a Select button, display the price of the service.arrow_forward
- Alert dont submit AI generated answer.arrow_forwardJava Programming: Advanced GUIs and Graphics (doing an Applet) Creat an applet to draw a digit using the method fillRect of the class Graphics. Fpr instance, if the input is 4, the applet will display 4. Thank you and for some reason I cannt paste my code for this program--sorryarrow_forwardyou please help me with this code because I am struggling, I added my code in the photo:question that I need help with:you will develop an AI for a game in which two players take turns placing 1 x 2 dominoes on a rectangular grid. One player must always place his dominoes vertically, and the other must always place his dominoes horizontally. The last player who successfully places a domino on the board wins. an infrastructure that is compatible with the provided GUI has been suggested. However, only the search method will be tested, so you are free to choose a different approach if you find it more convenient to do so. The representation used for this puzzle is a two-dimensional list of Boolean values, where True corresponds to a filled square and False corresponds to an empty square.tasks: In the DominoesGame class, write a method is_legal_move(self, row, col, vertical) that returns a Boolean value indicating whether the given move can be played on the current board. A legal move must…arrow_forward
- Java Question - Instructions are in the attached pictures. The picture titled "Screenshot..." are the instructions for building the specific code, while the "Final Output" picture shows what the output of the code should look like. Thank you.arrow_forwardCreate a NetBeans project for this activity and create a Java GUI with events of a Simple Calculator based on the given screenshot below: The simple calculator should be able to display the computed result based on the operation. The Reset button should clear all values entered and displayed. When the Quit button is clicked, a JOptionPane window will display an information as shown before the program terminates. The program codes should be hard-coded.arrow_forwardDesign the wireframes and storyboard, interactivity diagram, object dictionary, and any necessary scripts for an interactive program for customers of the Titans Cafe. Allow customers the option of choosing one of three types of bread and any number of six filler items for a sandwich. After the customer clicks an Order Now button, display the price of the sandwich.arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education