Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help creating the daily double aspect of jeopardy which a random block on my5x5 board is selected in which the user places a

I need help creating the daily double aspect of jeopardy which a random block on my5x5 board is selected in which the user places a bet on how many points they win if they guess correctly or how much there willing to lose. if guessed correctly, it would double the amounts of points that they chose to win. If they lose they lose the amount of points they had.

class inputs: #creating questions and answers for the jeopardy game.
    def __init__(self, name, questions):
        self.name = name
        self.questions = questions

class values: #values for the game.
    def __init__(self, value, question, answer):
        self.value = value
        self.question = question
        self.answer = answer
nba = [values(100, "Most Recent NBA Title Winner? (answer in lower case, and do not use any abbreviation!)", "golden state warriors"),
       values(200, "Which NBA Player Holds The Title For Most 3 Pointers Made In a Single Season?", 'stephen curry'),
       values(300, 'Which NBA Player Holds The Record For Most Points In A Single Game?', 'wilt chamberlain'),
       values(400, 'The 1970s Lakers Team Were Known As?', 'showtime lakers'),
       values(500, 'Which Utah Jazz Player Broke The All Time Record For Career Assists and Steals?', 'john stockton')]
   
movie = [values(100, 'When Was The First Star Wars movie released', '1977'),
         values(200, 'What Insect is Ron Weasley Afraid of In The Hary Potter Series', 'spider'),
         values(300, 'What Role is Mark Hamill Famously Known For?', 'luke skywalker'),
         values(400, 'When Did George Lucas sell Star Wars to Disney?', '2012'),
         values(500, 'How Many Oscars Nominations Did the MOvie Titanic Receive?', '14')]

music = [values(100, 'What is the Most Streamed Song on Spotify?', 'blinding lights'),
         values(200, 'This Artist Real Name is Aubrey Graham', 'drake'),
         values(300, "What is Ed Sheeran's most Streamed Song on Spotify (answer in lowercase)", 'shape of you'),
         values(400, 'Which Artist Holds The Record for Most Grammy Awards Won in A Lifetime?', 'beyonce'),
         values(500, 'Which Song did Ed Sheeran Write For Justin Bieber?', 'love yourself')]

berkeley = [values(100, 'What is the Name of the Introductory Data Science Class at UC Berkeley?', 'data 8'),
            values(200, 'What Class is John Denero Famously Known For?', 'cs61a'),
            values(300, 'What Year Was UC Berkeley Founded?', '1868'),
            values(400, 'What is the Name of the Oldest Building on Campus?', 'south hall'),
            values(500, 'WHAT SCHOOL DO WE HATE?', 'stanford')]

soccer = [values(100, 'Who Won the 2022 FIFA World Cup?', 'argentina'),
          values(200, 'What Team Holds the Record for most UEFA Champions League titles?', 'real madrid'),
          values(300, "What is the Name of FC Barcelonona's Academy?", 'la masia'),
          values(400, 'Which Player Holds the Record for Most Goals Scored in a Calendar Year in the Last 20 Years? (just the last name)', 'messi'),
          values(500, 'Which Award is Famously Named after a Player? (Answer in This Format: ____ award)', 'puskas award')]

categories = [inputs('NBA', nba),
              inputs('Movies ', movie),
              inputs('Music', music),
              inputs('Berkeley', berkeley),
              inputs('Soccer', soccer)]

scores = [100, 200, 300, 400, 500]


# Print the board rows
def board():
    for i in range(5):
        for j in range(5):
            category = categories[j]
            question = category.questions[i]
            value = scores[i]
            print(f"|${value:<2} {category.name:<12}", end="")
        print("|\n", "-" * 80)
board()
#Feature 2: Playing the game
def play(): #custom function
    score = 0 # non-trivial list
    first_player = input('Enter your name: ')
    second_player = input('Enter your name: ')
    hello = [first_player, second_player]
    random.shuffle(hello)
    print(f"{hello[0]} goes first")

    for i in range(5):
        for j in range(5):
            category = categories[j]
            question = category.questions[i]
            value = scores[i]

            print(f"\n{category.name} with value ${value}")
            answer = input(question.question)
            b = answer.strip() #this line strip the input of any white spaces
            c = b.lower() #this line strip turns the string into a lowercase
            if c == question.answer:
                print("Correct")
                score += value
            else:
                print('Wrong')
            hello.reverse()
play()

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

Modern Systems Analysis And Design

Authors: Joseph Valacich, Joey George

8th Edition

0134204921, 978-0134204925

More Books

Students also viewed these Programming questions