This repository was archived by the owner on Jan 26, 2023. It is now read-only.
Replies: 1 comment 4 replies
-
Why would there be negative values? The single-unit offset of (1,1) is one of (0,1), (1,0), (2,1) or (1,2). None of the offsets should result in a negative coordinate value. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I got an error regarding line126: "final var wallPos = new Position(1, 1).offsetBy(direction.getOffset());" when running one of the GameControllerTest Test:
@EnumSource(value = Direction.class)
"@DisplayName("Make Move - Move to Adjacent Wall, Unlimited Lives")
void testMakeMoveToAdjacentWallUnlimitedLives(final Direction direction)"
The error message says that:
Position coordinates cannot be of a negative value.
java.lang.IllegalArgumentException: Position coordinates cannot be of a negative value.
But it seems to me that negative valuables are unavoidable for direction.getOffset(), for you have to test all four directions.
And "Position coordinates cannot be of a negative value." are also a restriction that cannot be deleted, right?
So, what's wrong with my understanding? How to fix this?
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions