ajout du puit
Some checks failed
rock-paper-scissors/pipeline/head There was a failure building this commit

This commit is contained in:
2025-11-27 09:49:50 +01:00
parent 9865e9dcc2
commit 0a5f32c883
2 changed files with 6 additions and 2 deletions

View File

@@ -3,13 +3,15 @@ package fr.iut_fbleau.info.but3.automation.rock_paper_scissors.play.domain;
public enum Move {
ROCK,
PAPER,
SCISSORS;
SCISSORS,
WELL;
public boolean beats(Move other) {
return switch (this) {
case ROCK -> other == SCISSORS;
case PAPER -> other == ROCK;
case SCISSORS -> other == PAPER;
case WELL -> other == ROCK || other == SCISSORS;
};
}
}

View File

@@ -33,7 +33,9 @@ class MoveTest {
return Stream.of(
Arguments.of(Move.ROCK,Move.SCISSORS),
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.SCISSORS)
);
}
}