Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This question released for assignment..I don't understand thus unable to complete..Anyone here can help me with this assignment? Question 3 Develop a simple game application

This question released for assignment..I don't understand thus unable to complete..Anyone here can help me with this assignment? image text in transcribed
image text in transcribed
Question 3 Develop a simple game application without using the data type dictionary. Allow any number of players to play MasterMind together For the game design and implementation, you must adhere to the following constraints Start the application by asking the user how many players will be playing MasterMind and the names of the players. Before each new game commences, the application randomly generates a hidden code. To generate the hidden code, the application makes 4 random choices to pick 4 different colors from 6 colors (stored as a string "RGBYoP). The letters represent the 6 distinct colors: Red, Green, Blue, Yellow Orange and Purple. The random choices are stored as a single string e.g "YBRP Players take turns to make a guess, the order follows the order the names are entered. When it is a player's turn, he guesses the colors and positions of the hidden code. The guess is read as a string and consists of 4 letters eg. "BORY". The result of his guess is displayed before the next player takes his turn. Show both the before and after score of a player after his guess is checked. The next player then takes his tun, cach guess is checked and the score updated, until the game ends when the hidden code is broken, that is, a player gets 4 black pins. At the end of each game, print out the details of the players and list the winner(s). The output should be shown on both screen and file Each right color in the wrong position cans the player a white pin which is worth 1 point, and each right color in the right position carns the player a black pin or 5 points. In this example, the guess earns 2 white pins and I black pin, and the program displays WWB, subjected to this consideration: Only additional pins a player gets will cam him points Only additional pins a player gets will earn him points. For example assume that throughout game play thus far, the best performance for white pins is 2 and the best performance for black pins is 0. If now, a player guesses and gets a black pin and a white pin, he will be awarded 5 more points as he has 1 additional black pin. His white pin does not earn him any points as he has no additional white pin. At the end of each game, add 1 to the number of games won to the player that breaks the code and to any player that has the most points for that game. Therefore, a player that breaks the code and who also has the most points will have 2 added to the number of games won thus far .When the players decide to stop playing, print out the players with the most number of games won. The output should be shown on both screen and file

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Management System MCQs Multiple Choice Questions And Answers

Authors: Arshad Iqbal

1st Edition

1073328554, 978-1073328550

More Books

Students also viewed these Databases questions

Question

Write an elaborate note on marketing environment.

Answered: 1 week ago

Question

=+j Describe how EU directives impact IHRM.

Answered: 1 week ago

Question

=+and reduction in force, and intellectual property.

Answered: 1 week ago