Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Program #2 - Due 26 March 2021 CSC 170/111 Your assignment is to write a program that will mimic the gameshow Wheel of Fortune. A

Program #2 - Due 26 March 2021 CSC 170/111 Your assignment is to write a program that will mimic the gameshow Wheel of Fortune. A random phrase with associated category will be chosen from a list of 10 different options. You will then display a welcome message ("Wheel of Fortune), followed by an empty board with underscores where letters belong and spaces where they do not (no punctuation or multiple lines are required), followed by the category centered at the bottom of the board. The user will then be presented with a menu of options with a prompt asking what they'd like to do in your best Pat Sajak voice of course) both of which are illustrated below. and then promped them for a letter in this version of Wheel, you do not have to "buy a vowel", they are free of charge). Once a letter has been chosen, you will compare this letter to each letter in the phrase and respond accordingly (suppose the player chooses the letter Z): If the letter is not in the puzzle, you will simply respond "Sorry, there is no Z". They will not accumulate the dollar amount in their bank for a missed letter. You will then display the menu options again and ask them what they'd like to do (see below). 1. Spin 2. Solve 3. Quit Game What would you like to do? 1 ? Spin = $708 Guess Letter: z Wheel of Fortune Before and After Sorry, there's no Z 1. Spin 2. Solve 3. Quit Game What would you like to do? 1. Spin 2. Solve 3. Quit Game What would you like to do? | User Selection Spin: If the user chooses to spin, you will display what value their spin was worth as if they actually "spun the wheel". These values are stored in a list of integers (provided) that correspond to the dollar amounts commonly found on the wheel (see below). If the letter is in the puzzle, you will count how many occurances there are, this will be a multiplier for the dollar amount their spin landed on which will be added to the accumulation of their bank account. You will then update the board to display the "new gameboard" illustrating where the letter(s) they have selected reside (you must show all the locations). You will then display the menu options again and ask them what they'd like to do (see below). LOSE PLAS i 1. Spin 2. Solve 3. Quit Game DOO OOC What would you like to do? 1 weaxz Spin = $982 Le Guess Letter: a Wheel of Fortune A_ - . Before and After You'll notice that there are 24 different "values", two of which are bankrupt, one lose a turn, and one free play (this has been replaced with a dollar value). If the user's spin lands on bankrupt, you will display a message letting them know they just went bankrupt and you will clear their bank account to zero. If the user's spin lands on lose a turn, you will display a message they have lost their turn but this has no effect on the accumulation of their bank account. If the user's spin lands anywhere else, you will display the associated dollar amount Yes, there are 3 A's Your Total is $2700 1. Spin 2. Solve 3. Quit Game What would you like to do? Solve: If the user chooses to solve, you will prompt them to enter the phrase they believe is the solution. You will then compare their solution to the puzzle phrase and respond accordingly. If their guess is correct, you will display a message "Congratulations!!!!! Your winnings are $2500" where their winnings will display their accumulated bank total. You will then end the game. If their guess is incorrect, you will display "Sorry, that's not quite correct." You will then display the main menu letting them choose another option. Examples are shown below. Wheel of Fortune Wheel of Fortune update_list: Takes three arguments, the puzzle phrase, the allocated list of characters, and a letter guessed by the user. This function returns the updated list of characters where each "_" is replaced with the corresponding letter in the puzzle if there's a match. print_board: Takes two arguments, the list of characters and the category of the phrase. This function does not return anything, it simply prints the board layout (welcome message, underscores and spaces for the phrase, and the category centered below the puzzle). You may also wish to write some helper functions to help ease the burden (recall there are many methods associated with string - use them to your advantage.) Remember, try to functionalize when possible. Timeline: ALCA__ LA - On the Map Fun and Games Yes, there's one C Your Total is $3560 1. Spin 2. Solve 3. Quit Game What would you like to do? 2 What's your guess? Alcatraz Island 1. Spin 2. Solve 3. Quit Game What would you like to do? 2 What's your guess? This is hard Sorry, that's not quite correct. 1. Spin 2. solve 3. Quit Game What would you like to do? Feb. 26: Mar. 5: You should have the menu options and board printing completed. Printing the updated board should be functional when a user guesses a correct letter. Congratulations!!!!! Your winnings are $ 35ee Mar. 19: All helper functions should be operational and you should be working through the overall program logic and execution. Your program is due at midnight. It should be commented, have a program header and function header similar to that of program 1. Mar. 26: Quit Game: If the user chooses to quit the game, you will simply display a message "Thank your for playing!" and exit the program. Main Program Steps You will be provided with a python file entitled "PhraseGen.py", this file includes three lists (one for phrases, one for their corresponding category, and one for the wheel values) as well as a function called GeneratePhrase. The function takes no arguments but returns the random phrase along with it's corresponding category. This function will be called in your main program to get the puzzle phrase and category for the game. You will import this functionality by adding the following line to the top of your program: from PraseGen import* You will need to write several different functions to accomplish string population, manipulation, and comparisons. At a minimum, you will have the following: spin: Takes a single argument (list of wheel values - provided via the import*), returns a single value in the list (note:-2 implies a bankruptcy and -1 implies a lose turn, anything else is a dollar value). user_selection: Takes no arguments, displays the menu items above, error checks, and returns the user's selection. Comments and suggestions. Do not delay, Start writing the program early. If you wait until the night before the due date, you will have a miserable night. Do not try and write the entire program all at one time. Work on the program in small sections (recall our example of incremental programming), as the timeline indicates. Write ample test scripts (stubs and drivers) along the way to ensure each sub-module is working exactly as expected before moving on to the next module. Notes: Be sure to follow the coding style guidelines that can be found in D2L in Supplemental Materials. . Name your program prog2.py. Points will be deducted if this naming convention is not followed. build_board_list: Takes two arguments, a puzzle phrase and a list that is allocated to be the size of the puzzle. This function returns the populated list where it will populate the list with "_" (underscore + space) at the index the phrase contains a letter, and " " (space) at the index the phrase contains a space. Be sure your code file is readable and neat. Do not allow lines to extend past 80 characters, use appropriate white space, Program Submission Submit your program code (the prog2.py file only) in the D2L dropbox by 11:59pm 26 Mar.

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

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

More Books

Students also viewed these Programming questions