forked from pierront/rock-paper-scissors
update-code #1
@@ -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 || other == WELL );
|
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);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user