• File names: pokemon.py Pokemon was a worldwide cartoon, video game and card-game phenomenon. My nephews used to play the card game for hours every day. For this problem, you will write a program that runs a Pokemon tournament Rules: We'll use a variation of Rock-Paper-Scissors (RPS) to manage each Pokemon battle. The rules are simple and work as follows: • Rock vs. Scissors: Rock wins. • Paper vs. Rock: Paper wins. • Scissors vs. Paper: Scissors wins. At the beginning of each round, a player secretly makes their selection (rock, paper or scissors). Simultaneously the players display their choices. If both players display the same selection, it's a draw. Otherwise the winner is determined by the RPS "what beats what" designation above. The names of the Pokemon for this tournament are as follows • Bulbasaur, Charmander, Butterfree, Rattata, Weedle, Pikachu, Sandslash, Jigglypuff, Raichu, Diglett You can find these and other characters from the Pokemon universe here: https://www.ranker.com/list/complete-list-of-all-pokemon- characters/vide0-game-info - Requirements: The order of the pokemons listed above is important. Bulbasaur is pokemon 1, Charmander is pokemon 2 and so on. The special case is Diglett, who is the "default" pokemon. For this game, use the following values: Rock = 1, Paper == 2, and Scissors == 3 • You must provide two functions as part of your solution: • get_player ( num ) and • check_battle( computer, player ) get player() returns the name of the pokemon associated with the numbering scheme described above. For example, calling get_player(2) returns Charmander. Calling get_player(101) returns Diglett (the default pokemon) check battle () returns the result of a single Rock-Paper-Scissors encounter. Inputs are the RPS selections for the computer and player and the return value is a string that has one of these values: "DRAW!" (if the RPS battle is a tie), "COMPUTER" (if the computer RPS value defeats the player value) or "PLAYER" (if the player RPS value defeats the computer value) Our auto-tester will validate these functions. Once you have completed the functions described above, finish building the rest of the game as described below: Your program will implement a computer vs. human Pokemon tournament. You must allow the human to select which team they want to "coach" (Red or Blue). Each team will automatically select from the Pokemon list to determine which Pokemon they are playing for the current round. Both teams use the same set of Pokemon, so it's okay if both teams field the same Pokemon for the match (e.g.: Red Jigglypuff vs. Blue Jigglypuff).

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter9: Advanced Array Concepts
Section: Chapter Questions
Problem 2GZ
icon
Related questions
Topic Video
Question

It is a python program. Make sure it works and run in IDLE 3.10. Please show the code screenshot and output screenshot.

• File names: pokemon.py
Pokemon was a worldwide cartoon, video game and card-game phenomenon. My nephews used to play the card game for hours every day. For
this problem, you will write a program that runs a Pokemon tournament
Rules:
We'll use a variation of Rock-Paper-Scissors (RPS) to manage each Pokemon battle. The rules are simple and work as follows:
• Rock vs. Scissors: Rock wins.
• Paper vs. Rock: Paper wins.
• Scissors vs. Paper: Scissors wins.
At the beginning of each round, a player secretly makes their selection (rock, paper or scissors). Simultaneously the players display their choices. If
both players display the same selection, it's a draw. Otherwise the winner is determined by the RPS "what beats what" designation above.
The names of the Pokemon for this tournament are as follows
• Bulbasaur, Charmander, Butterfree, Rattata, Weedle, Pikachu, Sandslash, Jigglypuff, Raichu, Diglett
You can find these and other characters from the Pokemon universe here: https://www.ranker.com/list/complete-list-of-all-pokemon-
characters/video-game-info
Requirements:
The order of the pokemons listed above is important. Bulbasaur is pokemon 1, Charmander is pokemon 2 and so on. The special case is Diglett,
who is the "default" pokemon.
For this game, use the following values: Rock = 1, Paper == 2, and Scissors == 3
• You must provide two functions as part of your solution:
• get_player ( num ) and
o check_battle ( computer, player )
get player () returns the name of the pokemon associated with the numbering scheme described above. For example, calling
get_player (2) returns Charmander. Calling get_player (101) returns Diglett (the default pokemon)
check battle () returns the result of a single Rock-Paper-Scissors encounter. Inputs are the RPS selections for the computer and player and
the return value is a string that has one of these values: "DRAW!" (if the RPS battle is a tie), "COMPUTER" (if the computer RPS value defeats the
player value) or "PLAYER" (if the player RPS value defeats the computer value)
Our auto-tester will validate these functions. Once you have completed the functions described above, finish building the rest of the game as
described below:
Your program will implement a computer vs. human Pokemon tournament. You must allow the human to select which team they want to "coach"
(Red or Blue). Each team will automatically select from the Pokemon list to determine which Pokemon they are playing for the current round. Both
teams use the same set of Pokemon, so it's okay if both teams field the same Pokemon for the match (e.g.: Red Jigglypuff vs. Blue Jigglypuff).
Transcribed Image Text:• File names: pokemon.py Pokemon was a worldwide cartoon, video game and card-game phenomenon. My nephews used to play the card game for hours every day. For this problem, you will write a program that runs a Pokemon tournament Rules: We'll use a variation of Rock-Paper-Scissors (RPS) to manage each Pokemon battle. The rules are simple and work as follows: • Rock vs. Scissors: Rock wins. • Paper vs. Rock: Paper wins. • Scissors vs. Paper: Scissors wins. At the beginning of each round, a player secretly makes their selection (rock, paper or scissors). Simultaneously the players display their choices. If both players display the same selection, it's a draw. Otherwise the winner is determined by the RPS "what beats what" designation above. The names of the Pokemon for this tournament are as follows • Bulbasaur, Charmander, Butterfree, Rattata, Weedle, Pikachu, Sandslash, Jigglypuff, Raichu, Diglett You can find these and other characters from the Pokemon universe here: https://www.ranker.com/list/complete-list-of-all-pokemon- characters/video-game-info Requirements: The order of the pokemons listed above is important. Bulbasaur is pokemon 1, Charmander is pokemon 2 and so on. The special case is Diglett, who is the "default" pokemon. For this game, use the following values: Rock = 1, Paper == 2, and Scissors == 3 • You must provide two functions as part of your solution: • get_player ( num ) and o check_battle ( computer, player ) get player () returns the name of the pokemon associated with the numbering scheme described above. For example, calling get_player (2) returns Charmander. Calling get_player (101) returns Diglett (the default pokemon) check battle () returns the result of a single Rock-Paper-Scissors encounter. Inputs are the RPS selections for the computer and player and the return value is a string that has one of these values: "DRAW!" (if the RPS battle is a tie), "COMPUTER" (if the computer RPS value defeats the player value) or "PLAYER" (if the player RPS value defeats the computer value) Our auto-tester will validate these functions. Once you have completed the functions described above, finish building the rest of the game as described below: Your program will implement a computer vs. human Pokemon tournament. You must allow the human to select which team they want to "coach" (Red or Blue). Each team will automatically select from the Pokemon list to determine which Pokemon they are playing for the current round. Both teams use the same set of Pokemon, so it's okay if both teams field the same Pokemon for the match (e.g.: Red Jigglypuff vs. Blue Jigglypuff).
Your program should automate the selection of the Pokemon for both the human and the computer for each round. If both Pokemon selected the
same RPS choice, indicate that round is a "draw" and there is no winner.
Each Pokemon is then given the opportunity to make an RPS choice. The human player specifies their RPS choice for the Pokemon they are
"coaching"; your program should select a random RPS choice for the computer's Pokemon. After each round, the winner of the round is
announced and your program must ask the user if they want to continue playing.
Once the tournament is fınished, your program should print a message indicating who won the tournament (the human or computer) based on the
number of rounds each team won.
Example play is below
= RESTART: /Users/keithbagley/Dropbox/NORTHEASTERN UNIVERSITY/CS5001/SPRI
/Homework/HW3/pokemon.py
What team do you want (red or blue)? blue
RED pokemon Pikachu vs. BLUE pokemon Raichu
Enter 1 for Rock, 2 for Paper, 3 for Scissors 1
Pikachu played PAPER. Raichu played ROCK
My RED team wins with Pikachu!
Play again (y/n)?y
RED pokemon Butterfree vs. BLUE pokemon Bulbasaur
Enter 1 for Rock, 2 for Paper, 3 for Scissors 2
Butterfree played PAPER. Bulbasaur played PAPER
It's a draw! No winner
Play again (y/n)?y
RED pokemon Diglett vs. BLUE pokemon Charmander
Enter 1 for Rock, 2 for Paper, 3 for Scissors 3
Diglett played ROCK. Charmander played SCISSORS
My RED team wins with Diglett!
Play again (y/n)?n
Tournament has ended!
RED team: 2
BLUE team: 0
I WIN!!!
Transcribed Image Text:Your program should automate the selection of the Pokemon for both the human and the computer for each round. If both Pokemon selected the same RPS choice, indicate that round is a "draw" and there is no winner. Each Pokemon is then given the opportunity to make an RPS choice. The human player specifies their RPS choice for the Pokemon they are "coaching"; your program should select a random RPS choice for the computer's Pokemon. After each round, the winner of the round is announced and your program must ask the user if they want to continue playing. Once the tournament is fınished, your program should print a message indicating who won the tournament (the human or computer) based on the number of rounds each team won. Example play is below = RESTART: /Users/keithbagley/Dropbox/NORTHEASTERN UNIVERSITY/CS5001/SPRI /Homework/HW3/pokemon.py What team do you want (red or blue)? blue RED pokemon Pikachu vs. BLUE pokemon Raichu Enter 1 for Rock, 2 for Paper, 3 for Scissors 1 Pikachu played PAPER. Raichu played ROCK My RED team wins with Pikachu! Play again (y/n)?y RED pokemon Butterfree vs. BLUE pokemon Bulbasaur Enter 1 for Rock, 2 for Paper, 3 for Scissors 2 Butterfree played PAPER. Bulbasaur played PAPER It's a draw! No winner Play again (y/n)?y RED pokemon Diglett vs. BLUE pokemon Charmander Enter 1 for Rock, 2 for Paper, 3 for Scissors 3 Diglett played ROCK. Charmander played SCISSORS My RED team wins with Diglett! Play again (y/n)?n Tournament has ended! RED team: 2 BLUE team: 0 I WIN!!!
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Instruction Format
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT