Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question 5 The TrollerField to play the game of Trollering on Trollplanet is ready now and Mr. Trollzart, the Troller sports manager, tries the field
Question 5 The TrollerField to play the game of Trollering on Trollplanet is ready now and Mr. Trollzart, the Troller sports manager, tries the field out. The field is as shown below: The aim of the game is to start on the right-side oval part of the field, cross the rectangular field by hopping onto rotating moving plates to get to the left-side oval part of the field. The game is played as follows: The player runs towards the rectangular field from the right-side oval part of the field and hops on to one of the 10 rotating plates that move around and across the rectangular field. The player must hop on to three selected plates, one plate at a time, by riding with the plates to get across the rectangular field and then jump off at the left-side of the oval field. All the points for a player are computed based on the characteristics of each of the three plates on which the player hops. Each plate has three characteristics (trollPlateNum, trollPlatelmage and trollPlatePod) which are represented as follows: - trollPlateNum is the number on each troll plate, between and including 10 to 20 - trollPlatelmage is an image (Trollion, Troltigger, Trolcoug, Trolcheet, Troljag) on a plate that is represented by a number between and including 20 and 24 - trollPlatePod a pod label (Podone, Podtoo, Podree, Podoor, Podrive, Podix) each represented by a number between and including 1 and 6 Write a Python program to play the game of Trollering. Call the file containing your program trollering-PY. Your program should - get the name of the player who plays the game against an invisible player whose points for the game are randomly generated between and including 120 and 150 - generate 9 random integer trollValues; 3 for each of the plates on which the player hops, as follows: - 3 integer trollValues between and including 10 and 20 for the trollPlateNum - 3 integer trollValues between and including 20 and 24 for the trollPlatelmage - 3 integer trollValues between and including 1 and 6 for the trollPlatePod - compute the total trollValues for each of the three characteristics (trollPlateNum, trollPlatelmage and trollPlatePod) of the plates - compute the points for the player as follows: 0 if the sum of all three trollValues for trollPlateNum is more than or equal to 50, or the troliValue for trollPlatelmage for plate 1 is equal to the trollValue for trollPlatelmage for plate 2 and the sum of all trollValues for trollPlatePod are greater than 12 , then double the sum of trollValues for trollPlateNum and add it to sum of all three trollValues for trollPlatelmage and trollPlatePod, otherwise the player's points are computed as the sum of all the trollValues - print the name of the player, the points earned by the player and the invisible player's points and announce the winner of the game Note: See textbook page 165 for an example of random number generation. For example, the input prompts, input (shown in bold blue) and corresponding output from the program could
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started