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

Add game board #6

Merged
merged 9 commits into from
May 23, 2021
Merged

Add game board #6

merged 9 commits into from
May 23, 2021

Conversation

erickbickler
Copy link
Collaborator

No description provided.

Copy link
Owner

@HagenSR HagenSR left a comment

Choose a reason for hiding this comment

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

See comments

Copy link
Owner

@HagenSR HagenSR left a 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

@erickbickler erickbickler requested a review from HagenSR May 21, 2021 02:24
Copy link
Owner

@HagenSR HagenSR left a comment

Choose a reason for hiding this comment

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

Getting closer!

@HagenSR HagenSR linked an issue May 21, 2021 that may be closed by this pull request
@erickbickler erickbickler requested a review from HagenSR May 21, 2021 23:00
import math
from game.common.game_board import GameBoard

class TestGameBoard(unittest.TestCase):
Copy link
Owner

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

@erickbickler erickbickler requested a review from HagenSR May 23, 2021 01:21
Copy link
Owner

@HagenSR HagenSR left a 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)
Copy link
Owner

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
Copy link
Owner

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
Copy link
Owner

Choose a reason for hiding this comment

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

this is pog :D

@HagenSR HagenSR merged commit 3d45a51 into dev May 23, 2021
@HagenSR HagenSR deleted the add-game-board branch May 23, 2021 21:41
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.

Create Game Board
3 participants