Skip to content

Solution#672

Open
step-98 wants to merge 4 commits intomate-academy:masterfrom
step-98:develop
Open

Solution#672
step-98 wants to merge 4 commits intomate-academy:masterfrom
step-98:develop

Conversation

@step-98
Copy link

@step-98 step-98 commented Mar 15, 2026

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.

Review Summary

Great job on the overall implementation! The logic for the Battleship class is solid, and you've successfully implemented the extra validation and printing methods. However, this requires a small change before it can be approved. In your Ship class within app/main.py, the self.start and self.end attributes are assigned but never used after the __init__ method completes. This is a violation of a project requirement to remove unused attributes [CHECKLIST ITEM #4]. Since these values are only needed during object initialization to build the decks list, they should be used as local variables within __init__ instead of being stored on the instance. After you make this quick fix, your solution will be ready!


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

app/main.py Outdated
Comment on lines +21 to +22
self.start = start
self.end = end

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These attributes self.start and self.end are assigned but never used after the __init__ method completes. This violates checklist item #4: 'Remove unused attributes.' The start and end parameters are sufficient for creating the decks list within this method.

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.

Review Summary

Excellent work on this iteration! You've successfully fixed the previous issue with unused attributes in the Ship class, and the overall logic is solid. However, a similar issue now exists in the Battleship class. The self.ships attribute is assigned in the __init__ method but is only used locally within that same method.

This violates the requirement to remove unused attributes [CHECKLIST ITEM #4]. Please modify the code to use the ships parameter directly in the for loop on line 63 instead of assigning it to self.ships.

Once you make this small correction, your solution will be perfect. You're very close!


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

app/main.py Outdated
self,
ships: list,
) -> None:
self.ships = ships

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job addressing the previous feedback about unused attributes in the Ship class! However, a similar issue exists here. The self.ships attribute is assigned but only used within the __init__ method. According to checklist item #4 ('Remove unused attributes'), it should not be stored on the instance if it's not used elsewhere. You can use the ships parameter directly in the for loop on line 63.

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.

Review Summary

Excellent work on this task! I am approving your solution as it is now complete and correct. You've done a fantastic job addressing the feedback from the previous review by removing the unused attribute [CHECKLIST ITEM #4]. The code is clean, the logic is sound, and you've successfully implemented all the requirements, including the extra validation and field printing tasks. Keep up the great work!


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

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