Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please HELP ALL OF THIS THANK YOU!!! import random def getSecretNum (numDigits): Open with Drive Notepad # Returns a string that 13 numDigits long, made

Please HELP ALL OF THIS THANK YOU!!!

image text in transcribed

image text in transcribed

import random def getSecretNum (numDigits): Open with Drive Notepad # Returns a string that 13 numDigits long, made up of unique random digits numberslist (range (10)) randomshuffle (numbers) secretNum or i in range (numDigits): secretNum str (numbers[i]) return secretNum def getClues (guess, secretNum) # Returns a string with the pico, fermi, bagels clues to the user. if guesssecretNum: return 'You got it!' clue = [] or i in range (len (guess)) if guesisecretNum[1] clue.append (Fermi') elif guess[i] in secretNum: clue.append (Pico') 0: if len (clue ) -= return 'Bagels' clue.sort () return.join(clue) def is0nlyDigits(num): # Returns True if num is a string made up only of digits. Otherwise returns False return Falae for i in num: if i not in '0 123456789".splitO return False return True def playAgain () # This function returns True if the player wants to play again, otherwise it returns False print 'Do you want to play again? (yes or no) ') return input ).lower ).startswith ('y') NUMDIGITS3 MAXGUESS 10 print('I am thinking of a -digit number. Try to guess what it 13.. print ('Here are some clues:) print ("When I say: print( Pico print( Eermi print Bagels (NUMDIGITS)) That means:) One digit is correct but in the wrong position. One digit is correct and in the right position.') No digit is correct.') while True: secretMum-getSecretNum (NUNDIGITS) print('I have thought up a number. You have %s guesses to get it.' % (MAXGUESS)) numGuesses-1 while nunGuessesMAKGUESS: print ('You ran out of guesses. The answer was %s.' (secretNum)) if not playAgain): Python C11-Lab - Bagels Game Variation 1. Start with the Bagels code from the book. 2. Based on the bagels.py program extend the program- to Hex digits or 5 numbers: o Draw up a plan to modify the original game to the new game -- 10 points Review the code to see what needs to be changes and make a list of needed changes-5 points o Modify the Code to play new Bagels variation 25 points Make sure you add appropriate comments and program introduction. -- 5 points Test your game for each player win and lose plus various response combinations (capture 5 different image combinations) -5 points o Post your plan, updated game sources and screen captures to receive credit for this assignment 3. Once you have your Bagels game tested, Upload your code, and Game document (w/design and screen prints) to prove you completed the assignment

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

More Books

Students also viewed these Databases questions

Question

What is meant by 'Wealth Maximization ' ?

Answered: 1 week ago