Skip to content

Conversation

@Dearex
Copy link

@Dearex Dearex commented Aug 24, 2025

The rotations were only done once as (hex._rotate_clockwise() for _ in range(steps)) yields the same value over and over again, as hex doesn't change.
The step calculation yields the number of clockwise steps for negative angles, so I removed the distinction (otherwise abs the angle before mod).

Todo: Extend test file. The test didn't catch the issue as it only tests 0° and 60° rotation. Also the use of sets in the testfile allows for a simple change of the angles to also pass the test, as the opposing 120° hex rotations are the same set as 60° rotation. Thus I changed the return type to tuple

as hex._rotate_clockwise doesnt change the hex but returns a value, the rotation was only ever done once. the step-calculation yielded wrong steps for counterclockwise rotation.
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.

1 participant