Conversation
# Conflicts: # .gitignore # src/main/java/Main.java
# Conflicts: # src/main/java/homework_1/Main.java
PyramidPrinter update RandomCharsTable update
| String line = scan.next(); | ||
| String[] input = line.split(":"); | ||
| int hh = Integer.parseInt(input[0]); | ||
| int mm = Integer.parseInt(input[1]); | ||
| int ss = Integer.parseInt(input[2]); | ||
| validateInputMode2(hh, mm, ss, input.length); | ||
| seconds = ss + mm * 60 + hh * 3600; |
There was a problem hiding this comment.
You can make it much shorter, literally in a line. Check Class java.time.LocalTime. Have a look at parse() and toSecondOfDay() methods. It's better to use a ready-made bicycle than to reinvent it :)
There was a problem hiding this comment.
Thanks!)
Didn't know about that class' functionality.
You can make it much shorter, literally in a line. Check Class java.time.LocalTime. Have a look at parse() and toSecondOfDay() methods. It's better to use a ready-made bicycle than to reinvent it :)
| public void printTable() { | ||
| charList = new LinkedList<>(); | ||
| for (int i = 0; i < rows; i++) { | ||
| System.out.print("| "); |
There was a problem hiding this comment.
Please remove whitespace, it fail my tests. In AC the output is without whitespaces
|
Good, the apps run as expected. I'll continue review when I'll have time |
…ure/ChertovNikita
HW4 CFR removePunctuation update
HW5 test folder refactoring
| public class Main { | ||
|
|
||
| public static void main(String[] args) { | ||
| new SeaBattle().playVsComputer(); |
There was a problem hiding this comment.
Good use of abstractions, thorough knowledge of Java Core aspects and libraries. Well done!
To make better: Quite difficult to play, during ship placement the field does not show my placed ships. Also, you could Introduce random ship placement. And void methods are not thread-safe and easy to test, better use return values
| placePlayersShips(); | ||
| placeComputerShips(); | ||
| makeMoves(); | ||
| defineWinner(); | ||
| closeInput(); |
There was a problem hiding this comment.
Opt: these methods should have return values. It helps to test them separately. Better not to use void methods.
There was a problem hiding this comment.
Opt: ship placement is difficult to understand (h1 hor on empty field does not work)
| void placePlayersShips() { | ||
| new UserShipPlacer(scanner).placeShips(playersField); | ||
| } |
There was a problem hiding this comment.
Opt: It does not make sense to put oneliner into a separate method
| int result = Integer.hashCode(x); | ||
| result = 31 * result + Integer.hashCode(y); | ||
| return result; |
There was a problem hiding this comment.
| int result = Integer.hashCode(x); | |
| result = 31 * result + Integer.hashCode(y); | |
| return result; | |
| return 31 * Integer.hashCode(x)+ Integer.hashCode(y);; |
| * Immutable class is extremely well encapsulated! | ||
| */ | ||
|
|
||
| public final class Cafe { |
| import java.util.Scanner; | ||
| import java.util.stream.Stream; | ||
|
|
||
| public class CustomFileReader { |
There was a problem hiding this comment.
Many possible ways, good job!
| if (!tail.equals("")) { | ||
| throw new IllegalArgumentException(); |
There was a problem hiding this comment.
I don't understand the usage for this line
There was a problem hiding this comment.
Just an odd way to check if there is more then just two numbers...
Should simply use regex to validate input.
| import homework_7.util.Kitten; | ||
|
|
||
| @FunctionalInterface | ||
| public interface KittenToCatFunction <R extends Cat, T extends Kitten> { |
| private final String errorMsg = "Only 1 non-negative integer is allowed as passed parameter"; | ||
|
|
||
| @Test | ||
| void givenThree_whenRun_thenPrintPyramid() { |
There was a problem hiding this comment.
Special thanks for informative test cases names, it really helps
NikolaevArtem
left a comment
There was a problem hiding this comment.
Minor issues/code style fixes.
Except that, homework is accepted!
No description provided.