[lab-data-vikings] Guillermo Martínez#125
Open
guillermomar wants to merge 1 commit intoironhack-datalabs:masterfrom
Open
[lab-data-vikings] Guillermo Martínez#125guillermomar wants to merge 1 commit intoironhack-datalabs:masterfrom
guillermomar wants to merge 1 commit intoironhack-datalabs:masterfrom
Conversation
|
Morning in da morning! Tu ejercicio de los vikingos está ESPECTACULAR. Muy bien hecho!!! Solo como mejora te comentaría que en vez de hacer esto para el método receiveDamage: def receiveDamage(self, damage):
self.health -= damage
if self.health > 0:
return self.name + " has received " + str(damage) + " points of damage"
else:
return self.name + " has died in act of combat"Recuerda que si puede heredar de otras clases, entonces que herede aunque luego hagas modificaciones. def receiveDamage(self, damage):
super().receiveDamage(damage)
if self.health > 0:
return self.name + " has received " + str(damage) + " points of damage"
else:
return self.name + " has died in act of combat"Este quizás no es el mejor ejemplo, pero hay que acostumbrarse a reutilizar código. Por lo demás, genial!! Y por cierto, han ganado los Saxons en mi batalla.. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

commit lab-vikings that also includes the bonus with a battle game with armies