-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add game board #6
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.
See comments
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.
Also I think we should create a unit test for the circle_radius. maybe you can create a game_object unit test file and add a default game board in the init then check if the circle encompasses the map. Maybe not necessary but I think an example unit test would be good and this is really the only thing that needs to be checked
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.
Getting closer!
import math | ||
from game.common.game_board import GameBoard | ||
|
||
class TestGameBoard(unittest.TestCase): |
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.
So in The init.py file in the tests folder you need to import this test file and then add it to the string array. It looks like some of the tests fail as well. Remove the example test from the array, we don't need it
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.
Good Work!
@@ -13,5 +13,5 @@ def main(): | |||
if __name__ == '__main__': | |||
main() | |||
|
|||
# To run the test suite, make sure your terminal is in the root directory of the project (the 'byte_le_royale_2021 folder) | |||
# To run the test suite, make sure your terminal is in the root directory of the project (the 'byte_le_royale_2022 folder) |
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.
GOOD CATCH
# square board test | ||
def test_circle_square(self): | ||
game_board1 = GameBoard(10, 10) | ||
self.assertGreaterEqual(game_board1.circle_radius, .5 * math.sqrt(200)) # should succeed |
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.
I actually don't know how the game board coordinates are going to work, but we can talk about it tomorrow
self.assertAlmostEqual(game_board3.circle_radius, .5 * math.sqrt(325)) # shows possible rounding errors | ||
|
||
|
||
# check each corner's location, and if y value of corner is >= y value of the circle at that x, then that corner must be inside the circle |
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.
this is pog :D
No description provided.