fix ajout du puit et interaction avec la feuille
All checks were successful
rock-paper-scissors/pipeline/head This commit looks good

This commit is contained in:
2025-11-27 10:29:11 +01:00
parent e226acb899
commit 04e7e6e381
2 changed files with 3 additions and 2 deletions

View File

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

View File

@@ -35,7 +35,8 @@ class MoveTest {
Arguments.of(Move.PAPER,Move.ROCK), Arguments.of(Move.PAPER,Move.ROCK),
Arguments.of(Move.SCISSORS,Move.PAPER), Arguments.of(Move.SCISSORS,Move.PAPER),
Arguments.of(Move.WELL,Move.ROCK), Arguments.of(Move.WELL,Move.ROCK),
Arguments.of(Move.WELL,Move.SCISSORS) Arguments.of(Move.WELL,Move.SCISSORS),
Arguments.of(Move.PAPER,Move.WELL)
); );
} }
} }