Skip to content

Commit 85ef422

Browse files
committed
style: fix Checkstyle violations (utility constructor, braces, imports)
1 parent 665142a commit 85ef422

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/main/java/com/thealgorithms/puzzlesandgames/RockPaperScissors.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
*/
2020
public class RockPaperScissors {
2121

22+
private RockPaperScissors() {
23+
throw new UnsupportedOperationException("Utility class");
24+
}
25+
2226
public static void main(String[] args) {
2327
Scanner scanner = new Scanner(System.in);
2428
Random random = new Random();
@@ -60,8 +64,9 @@ public static String getResult(String userChoice, String computerChoice) {
6064
return "It's a tie!";
6165
} else if ((userChoice.equals("rock") && computerChoice.equals("scissors")) || (userChoice.equals("scissors") && computerChoice.equals("paper")) || (userChoice.equals("paper") && computerChoice.equals("rock"))) {
6266
return "You win! :D ";
63-
} else
67+
} else {
6468
return "You lose! :( ";
69+
}
6570
}
6671
public static String getRandomChoice() {
6772
String[] options = {"rock", "paper", "scissors"};

src/test/java/com/thealgorithms/puzzlesandgames/RockPaperScissorsTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.thealgorithms.puzzlesandgames;
2-
import static org.junit.jupiter.api.Assertions.*;
2+
import static org.junit.jupiter.api.Assertions.assertEquals;
3+
import static org.junit.jupiter.api.Assertions.assertTrue;
34

45
import org.junit.jupiter.api.Test;
56

0 commit comments

Comments
 (0)