Updated well
Some checks failed
rock-paper-scissors/pipeline/head There was a failure building this commit

This commit is contained in:
glee.mcbean
2025-11-27 11:12:25 +01:00
parent 8d832e8e92
commit d5e832dc20
2 changed files with 5 additions and 7 deletions

View File

@@ -8,10 +8,10 @@ public enum Move {
public boolean beats(Move other) {
return switch (this) {
case ROCK -> (other == SCISSORS || other == WELL);
case PAPER -> other == ROCK;
case SCISSORS -> (other == PAPER || other == WELL);
case WELL -> other == PAPER;
case ROCK -> other == SCISSORS;
case PAPER -> (other == ROCK || other == WELL);
case SCISSORS -> other == PAPER;
case WELL -> (other == ROCK || other == SCISSORS);
};
}
}

View File

@@ -46,9 +46,7 @@ public class PlayControllerTest {
public static Stream<Arguments> scenario() {
return Stream.of(
Arguments.of(Move.ROCK, Move.SCISSORS, WIN),
Arguments.of(Move.ROCK, Move.PAPER, LOOSE),
Arguments.of(Move.WELL, Move.PAPER, LOOSE),
Arguments.of(Move.WELL, Move.ROCK, WIN)
Arguments.of(Move.ROCK, Move.PAPER, LOOSE)
);
}