4 Commits

Author SHA1 Message Date
04e7e6e381 fix ajout du puit et interaction avec la feuille
All checks were successful
rock-paper-scissors/pipeline/head This commit looks good
2025-11-27 10:29:11 +01:00
e226acb899 fix test
All checks were successful
rock-paper-scissors/pipeline/head This commit looks good
2025-11-27 10:25:26 +01:00
3dc1222cbd ajout puit
Some checks failed
rock-paper-scissors/pipeline/head There was a failure building this commit
2025-11-27 10:08:46 +01:00
9b1af5029f Merge pull request 'update-code' (#6) from update-code into main
All checks were successful
rock-paper-scissors/pipeline/head This commit looks good
Reviewed-on: pierront/rock-paper-scissors#6
2025-11-26 17:06:38 +01:00
2 changed files with 4 additions and 3 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

@@ -14,7 +14,7 @@ class MoveTest {
@Test @Test
void should_check_move_size(){ void should_check_move_size(){
Assertions.assertEquals(3, Move.values().length); Assertions.assertEquals(4, Move.values().length);
} }
@ParameterizedTest(name = "{0} should beat {1}") @ParameterizedTest(name = "{0} should beat {1}")
@@ -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)
); );
} }
} }