Skip to content

Commit

Permalink
checksyntax
Browse files Browse the repository at this point in the history
  • Loading branch information
mizuo-san committed Jan 2, 2025
1 parent 00af0f2 commit f453c23
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
2 changes: 0 additions & 2 deletions src/main/java/core/basesyntax/Circle.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package core.basesyntax;

import java.lang.Math;

public class Circle extends Figure implements FigureMethods {
private final float radius;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/core/basesyntax/ColorSupplier.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import java.util.Random;

public class ColorSupplier {
private final static Random picker = new Random();
private static final Random picker = new Random();

public static Colors getRandomColor() {
return Colors.values()[picker.nextInt(Colors.values().length)];
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/core/basesyntax/FigureSupplier.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import java.util.Random;

public class FigureSupplier extends ColorSupplier {
private final static Random picker = new Random();
private static final Random picker = new Random();

public static Figure getRandomFigure() {
return switch(picker.nextInt(4)) {
return switch (picker.nextInt(4)) {
case 0 -> new Circle(getRandomColor(), picker.nextInt(1, 50));
case 1 -> new Rectangle(getRandomColor(), picker.nextInt(1, 50), picker.nextInt(1, 50));
case 2 -> new RightTriangle(getRandomColor(), picker.nextInt(1, 50), picker.nextInt(1, 50));
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/core/basesyntax/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ public static void main(String args[]) {
public static Figure[] listOfRandomFigures() {
Figure[] array = new Figure[6];

for(int i = 0; i < 3; i++) {
for (int i = 0; i < 3; i++) {
array[i] = FigureSupplier.getRandomFigure();
}

for(int i = 3; i < 6; i++) {
for (int i = 3; i < 6; i++) {
array[i] = FigureSupplier.getDefaultFigure();
}

return array;
}

public static void printArray() {
for(Figure i : listOfRandomFigures()) {
for (Figure i : listOfRandomFigures()) {
i.draw();
}
}
Expand Down

0 comments on commit f453c23

Please sign in to comment.