Commit 1b160964 authored by Théo BOUTEMY's avatar Théo BOUTEMY
Browse files

on peut relancer une partie sans recharger le programme

parent 26d8e547
......@@ -65,6 +65,8 @@ class Montagne(Piece):
self.nom = str(self.car())
self.numero = Montagne.nb_mont
Montagne.nb_mont += 1
if Montagne.nb_mont==3:
Montagne.nb_mont=0
def car(self):
"""
......@@ -323,6 +325,8 @@ class Elephant(Animal):
super().__init__(abscisse, ordonnee, orientation, plateau)
self.numero = Elephant.nb_elephant
Elephant.nb_elephant += 1
if Elephant.nb_elephant==5:
Elephant.nb_elephant=0
self.nom = str(self.car() + str(self.numero))
def car(self):
......@@ -336,6 +340,8 @@ class Rhinoceros(Animal):
super().__init__(abscisse, ordonnee, orientation, plateau)
self.numero = Rhinoceros.nb_rhino
Rhinoceros.nb_rhino += 1
if Rhinoceros.nb_rhino==5:
Rhinoceros.nb_rhino=0
self.nom = str(self.car() + str(self.numero))
def car(self):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment