Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Learning Objectives: By the end of this assignment you should be able to: - Design and code a variety of functions - Decide what parameters

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Learning Objectives: By the end of this assignment you should be able to: - Design and code a variety of functions - Decide what parameters are needed in a given situation - Decide if a return statement is needed in a given situation Use Lists (and their corresponding built-in functionality) to solve a problem Take a written description and create the corresponding Python code to solve that problem Design a small Python program Mastermind This game is traditional a two-player code breaking game. One player (i.e., the codemaker) creates a secret code of four colored pegs. The secret code can be made up of any combination of six options: Red, Green, Yellow, Purple, Black, or Orange and can include multiples of any color (e.g., Orange, Orange, Orange, and Black). The codebreaker attempts to guess the pattern (both in color and order) within 10 "turns"/guesses. Instructions: Create a python program that simulates the codebreaker side of the game. The "codemaker" player side will be stored within the program. The program will interact with the user by asking the user to enter a guess. The program will provide feedback on the guess. The feedback is summarized in the able below: Situation Feedback Indicate it is correct by replicating the peg color and location Peg of correct color placed in correct location Peg of correct color but incorrect location Use a white pin Wrong color peg Left blank (i.e., _) The program should also calculate a "score". The codemaker gets one point for each guess a codebreaker makes. The score for the player, the codebreaker, should be shown as a negative number Color Pegs Notation Color Peg Notation in Program Red

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 Application Development And Design

Authors: Michael V. Mannino

1st Edition

0072463678, 978-0072463675

More Books

Students also viewed these Databases questions