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

Hex rotation is invertex #52

Closed
ManevilleF opened this issue Mar 13, 2023 · 1 comment
Closed

Hex rotation is invertex #52

ManevilleF opened this issue Mar 13, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@ManevilleF
Copy link
Owner

Describe the bug

Hex rotation is inverted:

  • Hex::right rotates counter-clockwise instead of clockwise
  • Hex::left rotates clock wise instead of counter-clockwise

To Reproduce
Steps to reproduce the behavior:

#[test]
fn rotation() {
    let neighbors = Hex::ZERO.all_neighbors();
    for elems in neighbors.windows(2) {
        let [prev, next] = [elems[0], elems[1]];
        assert_eq!(prev.right(), next);
        assert_eq!(next.left(), prev);
    }
}

Expected behavior

The logic in both Hex::left and Hex::right should be inverted

@ManevilleF ManevilleF added the bug Something isn't working label Mar 13, 2023
@ManevilleF ManevilleF added this to the 0.6.0 milestone Mar 13, 2023
@ManevilleF
Copy link
Owner Author

nvm false alarm I got confused with the directions

@ManevilleF ManevilleF removed this from the 0.6.0 milestone Mar 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant