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

PutShipCommand boundary check bug #105

Closed
erjillsison opened this issue Mar 10, 2019 · 2 comments
Closed

PutShipCommand boundary check bug #105

erjillsison opened this issue Mar 10, 2019 · 2 comments
Assignees
Projects
Milestone

Comments

@erjillsison
Copy link

erjillsison commented Mar 10, 2019

isBodyWithinBounds() method in PutShipCommand does not work properly.
image

Line 123 and 124 should have > inequality instead of >=.
Also, because of the || on line 124, it ignores orientation which should not be the case.
e.g Put a length 2 ship horizontally on e4 on a size 5 map. Will result in invalid because it's not within bounds vertically.

@erjillsison erjillsison added this to the v 1.2 milestone Mar 10, 2019
@erjillsison erjillsison added this to To Do in v1.2 via automation Mar 10, 2019
@iwle
Copy link

iwle commented Mar 10, 2019

Good catch! I will rectify the inequality comparison bug.

For the second bug, until the put by orientation ability is included in the PutShipCommand, I will leave the default to horizontal boundary checking.

@iwle
Copy link

iwle commented Mar 12, 2019

Fixed bug. See #112.

@iwle iwle closed this as completed Mar 12, 2019
v1.2 automation moved this from To Do to Done Mar 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
v1.2
  
Done
Development

No branches or pull requests

2 participants