-
Notifications
You must be signed in to change notification settings - Fork 52
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
allow initial food placement for 8 snakes on 7x7 board #87
Conversation
My bad, I see there are some failing tests. I'll fix those |
Also realized I had misunderstood the ticket. |
{snakeHead.X + 1, snakeHead.Y - 1}, | ||
{snakeHead.X + 1, snakeHead.Y + 1}, | ||
} | ||
isSmallBoard := b.Width*b.Height <= BoardSizeSmall*BoardSizeSmall |
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.
Wasn't totally sure about this. I felt like boards smaller than 7x7 shouldn't be included either though.
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.
Looks good, and worked as expected when I tested a few combinations of board size and snakes.
* main: allow initial food placement for 8 snakes on 7x7 board (BattlesnakeOfficial#87) fix for readme, install as go package. go get is no longer supported (BattlesnakeOfficial#86) Add player and board size meta data to all game maps (BattlesnakeOfficial#84)
Food placement logic is altered such that small boards (7x7 or smaller) that have > 4 snakes will only spawn food in the center. This avoids a possible edge case in the original logic where the food placement for nearby snakes can overlap and throw an error.