forked from pierront/rock-paper-scissors
Ajout de l'outcome feuille bat puit
This commit is contained in:
@@ -9,7 +9,7 @@ public enum Move {
|
||||
public boolean beats(Move other) {
|
||||
return switch (this) {
|
||||
case ROCK -> other == SCISSORS;
|
||||
case PAPER -> other == ROCK;
|
||||
case PAPER -> other == ROCK || other == WELL;
|
||||
case SCISSORS -> other == PAPER;
|
||||
case WELL -> other == SCISSORS || other == ROCK;
|
||||
};
|
||||
|
||||
@@ -33,6 +33,7 @@ class MoveTest {
|
||||
return Stream.of(
|
||||
Arguments.of(Move.ROCK,Move.SCISSORS),
|
||||
Arguments.of(Move.PAPER,Move.ROCK),
|
||||
Arguments.of(Move.PAPER,Move.WELL),
|
||||
Arguments.of(Move.SCISSORS,Move.PAPER),
|
||||
Arguments.of(Move.WELL,Move.SCISSORS),
|
||||
Arguments.of(Move.WELL,Move.ROCK)
|
||||
|
||||
Reference in New Issue
Block a user