I do not know how to code Stadium part. Stadium (1.75 pts): Constructor () o Stadium
Question:
I do not know how to code Stadium part.
Stadium (1.75 pts):
• Constructor ()
o Stadium Name
o Pokemon A
o Pokemon B
• Battle Method:
o Follows the following sequence of events:
o Both Pokemon Speak to each other
o Next, the Pokemon attack each other until one of the Pokemon's health points is
0
o At each iteration, the health points and attacks of each Pokemon should display
to the user running the program
Below is what I did now.
class Pokemon:
def __init__(self, name, level=1, health=100, pokemon_type="Normal" ):
self.name = name
self.level = level
self.health = health
self.type = pokemon_type
def attack(self, attackee):
print(self.name, "Attacks",attackee.name )
attackee.health = attackee.health - 10
def speak(self):
print("Pokemon sound")
def __str__(self):
return "Pokemon: {}".format(self.name)
class Pikachu(Pokemon):
def __init__(self):
Pokemon.__init__(self, Pikachu, level=1, health=100, pokemon_type="Electic")
def attack(self, attackee):
attackee.health -= 10
print("\n",self.name,"Attacks",attackee.name,"Using Thrunderbolt")
def speak(self):
print("Pika Pika...Pikachu")
class Bulbasaur(Pokemon):
def __init__(self):
Pokemon.__init__(self, Bulbasaur, level=1, health=100, pokemon_type="Using Grass")
def attack(self, attackee):
attackee.health -=20
print("\n",self.name,"Attacks",attackee.name,"Razor Leaf")
def speak(self):
print("Bulba Bulba...Bulbasaur")
class Stadium():
def __init__(self, name, pokemon_a, pokemon_b):
pass
def battle(self):
pass
Microeconomics An Intuitive Approach with Calculus
ISBN: 978-0538453257
1st edition
Authors: Thomas Nechyba