Skip to content

[kagiura] iP#208

Open
kagiura wants to merge 20 commits intonus-cs2113-AY2425S2:masterfrom
kagiura:master
Open

[kagiura] iP#208
kagiura wants to merge 20 commits intonus-cs2113-AY2425S2:masterfrom
kagiura:master

Conversation

@kagiura
Copy link
Copy Markdown

@kagiura kagiura commented Feb 14, 2025

No description provided.

public class Wen {

private static int taskCount = 0;
private static Task[] tasks = new Task[100];
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 using magic numbers, declare 100 as a constant like TASKS_SIZE

default:
System.out.println(command);
addTask(input);
// System.out.println("Unknown command \""+command+"\"! Double check your message and try running again~");
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Delete the codes that are commented and not used.

final String command = input.split(" ", 2)[0];
final String commandArgs = input.split(" ", 2).length > 1 ? input.split(" ", 2)[1] : "";

switch (command) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

There should be no indentation for case clauses, refer to the Java Coding standard.


while (!command.equals("bye")) {
command = in.nextLine();
while (!input.equals("bye")) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The nested loop is not correctly indented, and consider whether you need the outer loop or not.

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