forked from pierront/rock-paper-scissors
Updated well
Some checks failed
rock-paper-scissors/pipeline/head There was a failure building this commit
Some checks failed
rock-paper-scissors/pipeline/head There was a failure building this commit
This commit is contained in:
@@ -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);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user