Skip to content
This repository was archived by the owner on Oct 25, 2021. It is now read-only.

Semen_Antufiev#23

Open
antufievsemen wants to merge 20 commits intomasterfrom
feature/SemenAntufiev
Open

Semen_Antufiev#23
antufievsemen wants to merge 20 commits intomasterfrom
feature/SemenAntufiev

Conversation

@antufievsemen
Copy link
Collaborator

No description provided.

@NikolaevArtem NikolaevArtem added wontfix bug Code fix needed and removed wontfix labels Jul 9, 2021
@NikolaevArtem NikolaevArtem changed the title Feature/SemenAntufiev Semen_Antufiev Jul 11, 2021
@antufievsemen antufievsemen added the readyForReview Sign for Artem to take a look label Jul 12, 2021
@NikolaevArtem NikolaevArtem added HW_1 Good to go style Style fix needed and removed bug Code fix needed readyForReview Sign for Artem to take a look labels Jul 13, 2021
@antufievsemen antufievsemen added the readyForReview Sign for Artem to take a look label Jul 13, 2021
@NikolaevArtem NikolaevArtem removed the readyForReview Sign for Artem to take a look label Jul 20, 2021
@NikolaevArtem NikolaevArtem added bug Code fix needed and removed style Style fix needed labels Jul 25, 2021
@antufievsemen antufievsemen added readyForReview Sign for Artem to take a look readyForStudentReview labels Jul 30, 2021
break;
}

System.out.println(arg + " : " + arg.length() + " letters");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
System.out.println(arg + " : " + arg.length() + " letters");
System.out.println(arg + ": " + arg.length() + " letters");

Scanner scanner = new Scanner(System.in);
String sizeAsString = scanner.nextLine();
if (!isNumber(sizeAsString)) {
System.out.println("ERROR! This is not a number");
Copy link
Collaborator

Choose a reason for hiding this comment

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

check the output format in the task

for (int i = 0; i < params.length; i++) {
params[i] = scanner.next();
}
if (!isNumber(params[0]) || !isNumber(params[1])) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

move validate to a new separate method (validateParams, for example)

params[i] = scanner.next();
}
if (!isNumber(params[0]) || !isNumber(params[1])) {
System.out.println("ERROR! This is not a number");
Copy link
Collaborator

Choose a reason for hiding this comment

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

check the output format in the task

}
String strategy = params[2];
int strategyMod;
if (strategy.equals("even")) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

move to a new separate method (getResult, for example)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Why

Copy link
Owner

Choose a reason for hiding this comment

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

Because your code is too complex and difficult to read

Scanner scanner = new Scanner(System.in);
String secondsAsString = scanner.next();
if (isNumber(secondsAsString)) {
System.out.println("ERROR! Seconds must be a number");
Copy link
Collaborator

Choose a reason for hiding this comment

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

check the output format in the task


private final int age;

private final int high;
Copy link
Collaborator

Choose a reason for hiding this comment

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

add new mutable class field

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For what

Copy link
Owner

Choose a reason for hiding this comment

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

I thought it's a requirement

int size = Integer.parseInt(sizeAsString);
for (int i = 0; i < size; i++) {
for (int j = 0; j <= i; j++) {
System.out.print("*");
Copy link
Owner

Choose a reason for hiding this comment

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

I thought we're printing x...

import java.util.Scanner;
import java.util.regex.Pattern;

public class PyramidPrinter {
Copy link
Owner

@NikolaevArtem NikolaevArtem Sep 2, 2021

Choose a reason for hiding this comment

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

image

Comment on lines +14 to +17
if (isNumber(sizeAsString)) {
System.out.println(ERROR_MESSAGE);
return;
}
Copy link
Owner

Choose a reason for hiding this comment

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

If number, then error?

import java.util.Scanner;
import java.util.regex.Pattern;

public class RandomCharsTable {
Copy link
Owner

Choose a reason for hiding this comment

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

image

Copy link
Owner

Choose a reason for hiding this comment

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

image

Copy link
Owner

Choose a reason for hiding this comment

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

image

Copy link
Owner

Choose a reason for hiding this comment

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

image

for (int i = 0; i < params.length; i++) {
params[i] = scanner.next();
}
if (isNumber(params[0]) || isNumber(params[1])) {
Copy link
Owner

Choose a reason for hiding this comment

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

Quite strange

Comment on lines +21 to +23
if (rows == 0 || columns == 0) {
return;
}
Copy link
Owner

Choose a reason for hiding this comment

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

It's not expected behaviour, according to chat

public static final String ERROR_MESSAGE = "Only 1 non-negative integer is allowed as passed parameter";
public static final String DAY_OVER = "The day is over";

public void run() {
Copy link
Owner

Choose a reason for hiding this comment

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

Here and in other places: i would recommend getting rid of multiple if/else statements and separate logic to other methods

@NikolaevArtem NikolaevArtem removed readyForReview Sign for Artem to take a look readyForStudentReview labels Sep 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug Code fix needed HW_1 Good to go

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants