-
Notifications
You must be signed in to change notification settings - Fork 78
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
[Chua Zhong Heng] iP #63
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm! good use of encapsulation
src/main/java/Nuke.java
Outdated
public static void printLine() { | ||
System.out.println(" ____________________________________________________________"); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can consider adding javadoc comments for each method for greater clarity.
src/main/java/Nuke.java
Outdated
add(itemList, markList, item); | ||
} | ||
dialogue(itemList, markList); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good use of naming standards, e.g camelCase
src/main/java/Nuke.java
Outdated
} | ||
printLine(); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good layout structure
src/main/java/Nuke.java
Outdated
int listIndex = Integer.parseInt(splitItem[1]); | ||
unmark(itemList, markList, listIndex); | ||
} else { | ||
add(itemList, markList, item); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentations just require one more space
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, your coding quality is very well done and your code is readable! Great job! 💯
src/main/java/Nuke.java
Outdated
printLine(); | ||
System.out.println(item); | ||
printLine(); | ||
echo(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
I like that you use recursion :)
src/main/java/Nuke.java
Outdated
int listIndex = Integer.parseInt(splitItem[1]); | ||
mark(itemList, markList, listIndex); | ||
} else if (item.length() > 6 && item.substring(0, 6).equals("unmark")) { | ||
String[] splitItem = item.split(" "); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this array be named "items" instead?
src/main/java/Nuke.java
Outdated
printLine(); | ||
} | ||
|
||
public static void main(String[] args) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that your main method is short and neat :D
src/main/java/Nuke.java
Outdated
public static void dialogue(ArrayList<String> itemList, ArrayList<String> markList) { | ||
Scanner input = new Scanner(System.in); | ||
String item = input.nextLine(); | ||
if (item.equals("bye")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that you use else-if instead of nesting 👍
This reverts commit 3dbdfbc.
Add Error Handling function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job on your first milestone! Not to bad, just that perhaps you might want to consider replacing all the magic number and magic string with variables and not sure if I am correct, there is a recursive call.
src/main/java/Event.java
Outdated
@@ -0,0 +1,15 @@ | |||
public class Event extends Task{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps you want to add an additional space in front of the curly paranthesis?
src/main/java/KenergeticBot.java
Outdated
printLine(); | ||
System.out.println(" Here are the tasks in your list:"); | ||
for (int i = 0; i < taskList.size(); i++) { | ||
System.out.printf(" %d.%s\n", i+1, taskList.get(i)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice to use printf
!
src/main/java/KenergeticBot.java
Outdated
|
||
public static void printGreetingMessage() { | ||
printLine(); | ||
System.out.println(" Hello! I'm KenergeticBot\n" + " What can I do for you?"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps you would like to replace all the magic strings and numbers in your code with variables for greater readability?
src/main/java/KenergeticBot.java
Outdated
System.out.println(KenergeticBotException.INVALID_COMMAND); // unable to print sad face ˙◠˙ | ||
} | ||
} | ||
botDialogue(taskList); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this recursion???
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps you would like to remove these extra spaces?
src/main/java/Task.java
Outdated
protected String taskType; | ||
protected int taskIndex; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps you would like to remove this unused variable?
Add Delete function
Add Save function
Add Find function
Add Java Documentation
No description provided.