Skip to content

imaginarys96 iP#73

Open
imaginarys96 wants to merge 29 commits into
nus-cs2113-AY2324S1:masterfrom
imaginarys96:master
Open

imaginarys96 iP#73
imaginarys96 wants to merge 29 commits into
nus-cs2113-AY2324S1:masterfrom
imaginarys96:master

Conversation

@imaginarys96

Copy link
Copy Markdown

No description provided.

Comment thread src/main/java/Task.java Outdated
protected boolean isDone;

public Task(String description) {
protected String type;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

type is ambiguous, can be mistaken as a verb, recommend to use taskType

Comment thread src/main/java/Chatbot.java Outdated
System.out.println("____________________________________________________________");
} else if ( input.startsWith("mark ") ) {
} else if (input.startsWith("mark ")) {
String number = input.replace("mark ", "").trim();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

number is ambiguous, recommend to use taskNumber

Comment thread src/main/java/Chatbot.java Outdated
} else if ( input.startsWith("mark ") ) {
} else if (input.startsWith("mark ")) {
String number = input.replace("mark ", "").trim();
int markTaskNo = Integer.parseInt(number);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

noun should not be named with a verb in it, recommend to combine with previous line and use taskNumber as previously mentioned

Comment thread src/main/java/Chatbot.java Outdated
if( markTaskNo > 0 ) {
tasks[markTaskNo-1].markAsDone();
if (markTaskNo > 0) {
tasks[markTaskNo - 1].markAsDone();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

using -1 magical number, would be good to define what the -1 means

Comment thread src/main/java/Chatbot.java Outdated
} else if ( input.startsWith("unmark ") ) {
} else if (input.startsWith("unmark ")) {
String number = input.replace("unmark ", "").trim();
int unmarkTaskNo = Integer.parseInt(number);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

variable name can be mistaken as an action, recommend to use unmarkedTaskNo

Comment thread src/main/java/Chatbot.java Outdated
System.out.println( " [" + tasks[unmarkTaskNo-1].getStatusIcon() + "] " + tasks[unmarkTaskNo-1].getDescription() );
System.out.println(" [" + tasks[unmarkTaskNo - 1].getStatusIcon() + "] " + tasks[unmarkTaskNo - 1].getDescription());
System.out.println("____________________________________________________________");
} else if ( input.startsWith("todo") ) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

unnecessary spaces for start and ends of brackets

Comment thread src/main/java/Task.java Outdated
this.isDone = false;
}

public String getTypeIcon() { return type; }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

curly bracket should start on a newline

@Musfirahe0556596 Musfirahe0556596 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.

Overall good job but some coding quality and standards to follow!

Comment thread src/main/java/chatbot/Chatbot.java Outdated
@@ -0,0 +1,128 @@
package chatbot;

import chatbot.*;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Imported classes should always be listed explicitly (avoid *)

Comment thread src/main/java/chatbot/Chatbot.java Outdated

public class Chatbot {

public static void main(String[] args) throws Exception {

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 long methods of more than 30 LoC

Comment thread src/main/java/chatbot/Chatbot.java Outdated
System.out.println("____________________________________________________________");
System.out.println(" Here are the tasks in your list:");
for (int i = 0; i < numOfTasks; i++) {
//System.out.println(" " + (i + 1) + ".[" + tasks[i].getTypeIcon() + "][" + tasks[i].getStatusIcon() + "] " + tasks[i].getDescription());

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remove commented code

Comment thread src/main/java/chatbot/Chatbot.java Outdated
System.out.println(" [" + tasks[unmarkedTaskNo - 1].getStatusIcon() + "] " + tasks[unmarkedTaskNo - 1].getDescription());
System.out.println("____________________________________________________________");
} else if (input.startsWith("todo")) {
String msg = input.replace("todo", "").trim();

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 foreign language words, slang, and names (msg)

Comment thread src/main/java/chatbot/Chatbot.java Outdated
System.out.println(" Now you have " + String.valueOf(numOfTasks) + " tasks in the list.");
System.out.println("____________________________________________________________");
} else if (input.startsWith("deadline")) {
String msg = input.replace("deadline", "").trim();

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 foreign language words, slang, and names (msg)

Comment thread src/main/java/chatbot/Chatbot.java Outdated
}

String byDate = msg.substring(msg.indexOf("/by ") + 4).trim(); // will contain the byDate
String desc = msg.substring(0, msg.indexOf("/by")); // will contain the deadline description

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 foreign language words, slang, and names (desc)

Comment thread src/main/java/chatbot/Chatbot.java Outdated
System.out.println(" Now you have " + String.valueOf(numOfTasks) + " tasks in the list.");
System.out.println("____________________________________________________________");
} else if (input.startsWith("event")) {
String msg = input.replace("event", "").trim();

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 foreign language words, slang, and names (msg)

Comment thread src/main/java/chatbot/Chatbot.java Outdated
String dateRange = msg.substring(msg.indexOf("/from ") + 6).trim();
String fromDate = dateRange.substring(0, dateRange.indexOf("/to ")).trim();
String toDate = dateRange.substring(dateRange.indexOf("/to ") + 4).trim();
String desc = msg.substring(0, msg.indexOf("/from ")); // will contain the deadline description

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 foreign language words, slang, and names (desc)

farissirraj pushed a commit to farissirraj/ip that referenced this pull request Sep 22, 2023
text-ui-test/runtest.bat|sh scripts generate a file ACTUAL.TXT.
However, .gitignore uses ACTUAL.txt, which means the generated
file will not be ignored by Git on non-Windows OS.

Let's update .gitignore as ACTUAL.txt -> ACTUAL.TXT
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