Skip to content

Conversation

@YoEnte
Copy link
Collaborator

@YoEnte YoEnte commented May 29, 2025

Description

Performance Possible Moves:
Some team made the discovery that the possible moves are extremly slow when handling cards (due to permutations)
-> made a much faster perform move which still generates the same moves (tested with eq() method)
-> kept old possible moves but renamed as reference and if somebody still wants to use it

Hurry Ahead Bug:
On some rare and weird occasions there where possible hurry ahead moves into goal violating the rules engine
-> added small and dirty fix
-> fix in rules engine always broke some other piece of code, therefore the small edge case fix

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?

Old and newly added tests
Via playing HUI

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

@YoEnte YoEnte requested a review from maxblan May 29, 2025 22:04
) -> Result<(), PyErr> {
let distance = target_position as isize - player.position as isize;

if target_position == 64 && (player.carrots > 10 || player.salads > 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should target_position == 64 && player.carrots > 10 && player.salads > 0, right?
The documentation writes the following:

Das Zielfeld darf nur betreten werden, wenn der Spieler höchstens zehn Karotten und keinen Salat besitzt.

I'm currently not 100% sure, but is the index of the goal not at 65? At least the constants.rs says so. Please verify.
Put these numbers in the constants.rs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it is 64, the index starts at 0, so we got the 65 in the constants... I used it like in hare.rs:72

@YoEnte YoEnte requested a review from maxblan May 31, 2025 17:10
@maxblan maxblan merged commit 6d9fd68 into master May 31, 2025
1 check passed
@YoEnte YoEnte deleted the fix-hurry-ahead-bug branch August 12, 2025 13:49
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.

3 participants