Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Solution #887

wants to merge 1 commit into from

Conversation

Anatolik-ua
Copy link

No description provided.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a 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:

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.

Comment on lines +11 to +12
lancelot.take_damage(mordred.power)
mordred.take_damage(lancelot.power)

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.

Comment on lines +14 to +15
arthur.take_damage(red_knight.power)
red_knight.take_damage(arthur.power)

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants