Skip to content

[LinSiyan]iP#181

Open
Celineyaa wants to merge 24 commits into
nus-cs2113-AY2324S2:masterfrom
Celineyaa:master
Open

[LinSiyan]iP#181
Celineyaa wants to merge 24 commits into
nus-cs2113-AY2324S2:masterfrom
Celineyaa:master

Conversation

@Celineyaa

@Celineyaa Celineyaa commented Feb 7, 2024

Copy link
Copy Markdown

[Level 0: Rename, Greet, Exit]

@Celineyaa Celineyaa changed the title Level 0: Rename, Greet, Exit [LinSiyan]iP Feb 7, 2024
@Celineyaa

Copy link
Copy Markdown
Author

Dear sir/madam,

Sorry to bother, however I tried to PR my master branch after I finished the level 1 2 and 3, but I can't find my pushed changes on my remote master branch, the updates only show up at the ipMyAnswer branch, however when I pushed in SourceTree, I chose both branches to push. So is there any way for me to show my updates on my master branches and send PR using my master branch? I will be grateful if you can do me this favor!

Yours,
Siyan

@ChoonSiang ChoonSiang left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Will need to avoid using magic numbers and apply abstraction to improve the readability of the main function.

Comment thread src/main/java/dukeRobot/Duke.java Outdated
@@ -0,0 +1,104 @@
import Duke.*;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Avoid importing *, should explicitly import the classes

Comment thread src/main/java/dukeRobot/Duke.java Outdated
Task[] tasks = new Task[100];
while (!userInput.contains("bye")) {

System.out.println("____________________________________________________________\n");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Should make this a constant since this line will be reused multiple times. Any changes made will also easily reflected.

Comment thread src/main/java/dukeRobot/Duke.java Outdated
} else if (userInput.contains("mark")) {
if (userInput.contains("unmark")) {

indexOfMark = Integer.parseInt(userInput.split(" ")[1]) - 1;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Avoid use of magic number. Try to have a descriptive variable for them

Comment thread src/main/java/dukeRobot/Duke.java Outdated
import java.util.ArrayList;
import java.util.List;
public class Duke {
public static void main(String[] args) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Very long function, more than 30 lines of code. Can consider abstracting out each command.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Could you please be more specific about the abstracting? Thanks!

Comment thread src/main/java/dukeRobot/Tasks/Task.java Outdated

public void markAsDone() {
this.isDone = true;
System.out.println("OK, I've marked this task as not done yet:\n");

Copy link
Copy Markdown

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("OK, I've marked this task as not done yet:\n");
System.out.println("OK, I've marked this task as done\n");

Comment thread src/main/java/dukeRobot/Tasks/ToDo.java Outdated
public class ToDo extends Task {
public ToDo(String description) throws ArrayIndexOutOfBoundsException{
super(description);
//System.out.println(description + "yes");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Try to remove unused comments

Comment thread src/main/java/dukeRobot/Duke.java Outdated
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.

2 participants