Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added solution #1198

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

added solution #1198

wants to merge 3 commits into from

Conversation

mikke966
Copy link

No description provided.

Copy link

@okuzan okuzan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there! 😊 Before you submit your work for review, please go through the checklist under the task and make any necessary corrections. 📝✅ Your mentor will be happy to help once those points are sorted out. Don't worry, it's all part of the learning process! 📚✨

@mikke966 mikke966 requested a review from okuzan November 27, 2023 17:10
Comment on lines +7 to +12
Ball ball = lottery.getRandomBall();
Ball ball1 = lottery.getRandomBall();
Ball ball2 = lottery.getRandomBall();
System.out.println(ball);
System.out.println(ball1);
System.out.println(ball2);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
Use loop for this

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not fixed

Comment on lines +7 to +21
public String getColor() {
return color;
}

public void setColor(String color) {
this.color = color;
}

public int getNumber() {
return number;
}

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better init using constructor

return null;

public Colors getRandomColor() {
int index = new Random().nextInt(Colors.values().length);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need only one Random object and you can create it field of class

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not fixed

}

public int getRandomNumber() {
return new Random().nextInt(100);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not fixed

Comment on lines +6 to +13
public Ball getRandomBall() {
ColorSupplier colorSupplier = new ColorSupplier();
String color1 = colorSupplier.getRandomColor().toString();
int number1 = getRandomNumber();
Ball ball = new Ball();
ball.setColor(color1);
ball.setNumber(number1);
return ball;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not fixed

@mikke966 mikke966 requested a review from Sanderfuck December 17, 2023 22:44
Copy link

@okuzan okuzan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
No changes since last review

@mikke966 mikke966 requested a review from okuzan December 20, 2023 19:02
Comment on lines +7 to +12
Ball ball = lottery.getRandomBall();
Ball ball1 = lottery.getRandomBall();
Ball ball2 = lottery.getRandomBall();
System.out.println(ball);
System.out.println(ball1);
System.out.println(ball2);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not fixed

return null;

public Colors getRandomColor() {
int index = new Random().nextInt(Colors.values().length);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not fixed

Comment on lines +6 to +13
public Ball getRandomBall() {
ColorSupplier colorSupplier = new ColorSupplier();
String color1 = colorSupplier.getRandomColor().toString();
int number1 = getRandomNumber();
Ball ball = new Ball();
ball.setColor(color1);
ball.setNumber(number1);
return ball;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not fixed

}

public int getRandomNumber() {
return new Random().nextInt(100);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants