Skip to content

Commit

Permalink
Fixed problems with commit and push all project files
Browse files Browse the repository at this point in the history
  • Loading branch information
vfilimo committed Dec 11, 2023
1 parent 619e3c4 commit 5561661
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 21 deletions.
17 changes: 7 additions & 10 deletions src/main/java/core/basesyntax/Ball.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,19 @@

public class Ball {
private String color;
private Integer number;
private int number;

public String getColor() {
return color;
}

public void setColor(String color) {
public Ball(String color, int number) {
this.color = color;
this.number = number;
}

public Integer getNumber() {
return number;
public String getColor() {
return color;
}

public void setNumber(Integer number) {
this.number = number;
public int getNumber() {
return number;
}

@Override
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/core/basesyntax/ColorSupplier.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

public class ColorSupplier {
public String getRandomColor() {
int inedex = new Random().nextInt(Colors.values().length);
Random random = new Random();
int inedex = random.nextInt(Colors.values().length);
return Colors.values()[inedex].toString();
}
}
14 changes: 7 additions & 7 deletions src/main/java/core/basesyntax/Colors.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package core.basesyntax;

public enum Colors {
Red,
Blue,
Yellow,
White,
Green,
Orange,
Violet
RED,
BLUE,
YELLOW,
WHITE,
GREEN,
ORANGE,
VIOLET
}
6 changes: 3 additions & 3 deletions src/main/java/core/basesyntax/Lottery.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

public class Lottery {
public Ball getRandomBall() {
Ball ball = new Ball();
Random random = new Random();
ball.setNumber(random.nextInt(100));
ColorSupplier supplier = new ColorSupplier();
ball.setColor(supplier.getRandomColor());
int randomNumber = random.nextInt(100);
String randomColor = supplier.getRandomColor();
Ball ball = new Ball(randomColor,randomNumber);
return ball;
}
}

0 comments on commit 5561661

Please sign in to comment.