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

Fix test_snake_collision_with_self to simulate self-collision #28

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

codez-bot[bot]
Copy link
Contributor

@codez-bot codez-bot bot commented Aug 18, 2023

Description

Fixed the test_snake_collision_with_self test in tests.py to correctly simulate a scenario where the snake collides with itself. The issue was that after moving the snake to the left, it did not collide with itself. By appending a new segment to the snake's tail after moving, we ensure that in the next move, the snake's head will collide with its body.

Summary

  • Modified snake_game_py/tests.py to append a new segment to the snake's tail after moving, ensuring a self-collision scenario.

Fixes #26.


To checkout this PR branch, run the following command in your terminal:

git checkout sweep/fix-test-snake-collision

To get Sweep to edit this pull request, leave a comment below or in the code. Leaving a comment in the code will only modify the file but commenting below can change the entire PR.

@codez-bot codez-bot bot added the hi hibox your software chores label Aug 18, 2023
@codez-bot codez-bot bot mentioned this pull request Aug 18, 2023
2 tasks
@femto
Copy link
Owner

femto commented Aug 18, 2023

revert

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hi hibox your software chores
Projects
None yet
Development

Successfully merging this pull request may close these issues.

hi:
1 participant