Question: ''' Main menu Each menu option should result in a function call, except for option 5 The function signature for option 1 is included and
''' Main menu Each menu option should result in a function call, except for option 5 The function signature for option 1 is included and should help you with the others Display Display each card in the hand on a single line Use the print() with the card object as the parameter Ex. print(card1) This means you should not call a method on the card object to determine what to print Each card should be displayed as "Title of Gang" Ex. Baker of Slugs Sort by Title Perform a sort using a selection, insertion, or bubble sort. A message should indicate which sort is used Use an existing function in the code to make it appear as if the program is processing Do not display the list of cards. The user should choose to display it after the sort is complete Sort by Gang Perform a sort using a selection, insertion, or bubble sort. Do not use the same sort technique as the Sort by Title A message should indicate which sort is used Use an existing function in the code to make it appear as if the program is processing Do not display the list of cards. The user should choose to display it after the sort is complete Search for Card Display submenus to allow the user to select a Title and Gang for the card to search for Use an existing sort algorithm to sort the hand Perform a binary search to determine if the card is in the hand Display a message indicating whether or not the card is in the hand ''' from modules.deck import Deck from time import sleep from modules.gronkyutil import convertCardToId from modules.gronkyutil import TITLE, GANG def main(): print("Welcome to Gronky Cards ") print("Shuffling Cards", end="") thinking() deck = Deck() playerHand = [] cardCount = int(input("How many cards would you like?: ")) for i in range(cardCount):
''' Use the module called gronkyutil.py This stores the map for TITLE and GANG It contains a function you can use to check to see if your id to title/gang conversion is working properly. It may also come in handy somewhere else (hint hint). ''' TITLE = ["One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Baker", "Jester", "Page", "Scribe", "Squire", "Armorer", "Marshal"] GANG = ["Jets", "Pollos", "Slugs", "Yokels", "Keiths", "Elbows"] def convertCardToId(cardTitle, cardGang): return GANG.index(cardGang) * len(TITLE) + TITLE.index(cardTitle)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
