feature: add well
All checks were successful
rock-paper-cissors/pipeline/head This commit looks good
rock-paper-cissors/pipeline/pr-main This commit looks good

This commit is contained in:
2025-11-27 10:14:59 +01:00
parent 9b1af5029f
commit 216cb51c0d
3 changed files with 10 additions and 5 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 PAPER -> other == ROCK || other == WELL;
case SCISSORS -> other == PAPER;
case WELL -> other == ROCK || other == SCISSORS;
};
}
}