Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi all, is there any suggested solution to this issue that I am facing with regards to the top-down design as well as the coding?

image text in transcribedimage text in transcribedimage text in transcribed

image text in transcribed

Hi all, is there any suggested solution to this issue that I am facing with regards to the top-down design as well as the coding?

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: Game Play 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 e.g... "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 turn, each 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. The players can repeatedly decide whether to play another game of MasterMind. If the players decide to stop play, print out the players with the most number of games won. The output should be shown on both screen and file. ion of scores and winners: Each right color in the wrong position earns the player a white pin which is worth 1 point, and each right color in the right position earns the player a black pin or 5 points. In this example, the guess earns 2 white pins and 1 black pin, and the program displays wWB, subjected to this consideration: Only additional pins a player gets will earn 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

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 Fundamentals Study Guide

Authors: Dr. Sergio Pisano

1st Edition

B09K1WW84J, 979-8985115307

More Books

Students also viewed these Databases questions