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 perform move bug #88

Merged
merged 3 commits into from
Jan 22, 2025
Merged

Fix perform move bug #88

merged 3 commits into from
Jan 22, 2025

Conversation

YoEnte
Copy link
Contributor

@YoEnte YoEnte commented Jan 20, 2025

Description

Fix: tiny but extremely breaking change in gamestate.perform_move(), where the carrots for pos1 and pos2 field have not been calculated correctly.
Add: gamestate.last_move to move.perform, was forgotten as "gamestate.last_move" got added.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How Has This Been Tested?

  • With GUI Server on logs
  • Test: New test for the fix, looks complicated, but it is basically a depth 2 calculation for the perform, with the options that the other player is in front or behind. Because of that I need to make changes to the test board in state_test.rs, but all other test still finish.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Fix: check which player is in front.
Add: check if player for update_carrot() is even on turn.
modify: test board to accommodate old and new tests, because salad field on 1 was a bit misplaced
@YoEnte YoEnte requested a review from maxblan January 21, 2025 09:09
Copy link
Collaborator

@maxblan maxblan left a comment

Choose a reason for hiding this comment

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

lgtm

@maxblan maxblan merged commit c07ef1b into master Jan 22, 2025
1 check passed
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.

2 participants