update-code #1

Open
Patrick FELIX-VIMALARATNAM wants to merge 5 commits from update-code into main
Showing only changes of commit 699de02810 - Show all commits

View File

@@ -3,13 +3,15 @@ package fr.iut_fbleau.info.but3.automation.rock_paper_scissors.play.domain;
public enum Move { public enum Move {
ROCK, ROCK,
PAPER, PAPER,
SCISSORS; SCISSORS,
WELL;
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);
}; };
} }
} }