-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Solution #887
base: master
Are you sure you want to change the base?
Solution #887
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job on organizing the code and implementing the classes and functions as required! 🎉 The structure is well thought out, and most of the functionality is spot on. However, make sure to adjust the damage calculation in the battle
function to account for the knights' protection, and update the type hint for the knights
parameter to dict
. Keep up the good work and happy coding! 😊
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
|
||
|
||
@staticmethod | ||
def battle(knights: str) -> dict: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type hint for knights
should be dict
instead of str
since you are accessing it as a dictionary.
lancelot.take_damage(mordred.power) | ||
mordred.take_damage(lancelot.power) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The damage calculation does not account for the knights' protection. According to the task description, you should subtract the knight's protection from the opponent's power when calculating damage.
arthur.take_damage(red_knight.power) | ||
red_knight.take_damage(arthur.power) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly, the damage calculation here should consider the knights' protection as described in the task requirements.
No description provided.