Skip to content
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

[ryanjansen] iP #219

Open
wants to merge 34 commits into
base: master
Choose a base branch
from
Open

Conversation

ryanjansen
Copy link

@ryanjansen ryanjansen commented Jan 25, 2023

Duke

Duke is a simple, easy to use task manager for those who can't remember jack.

Features

  • Add tasks
  • Delete tasks
  • Mark tasks as done

How to add a task

  1. Type "todo" followed by the title to add a todo
  2. Type "event" followed by the title, from date and to date to add a event
  3. Type "deadline" followed by the title, date, to add deadline

Here's a demo of checking a task:

  • A task
  • Another task

Here's an example of the code:

public class Main { public static void main(String[] args) { Application.launch(MainApp.class, args); } }

Copy link

@UnwilledTangent UnwilledTangent left a comment

Choose a reason for hiding this comment

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

I'm very impressed with your coding standards! Well done! The most that I have observed is just whitespaces that need to be added here and there! Other than that, no major violations! Keep up the good work! I'm sure that you will be a good programmer in the tP if you keep this coding standard up! :) Jiayous for the rest of CS2103!

private ArrayList<Task> tasks;

public TaskList() {
this.tasks = new ArrayList<>(100);

Choose a reason for hiding this comment

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

Oh? Is there a need to specify the capacity to 100? Why not use the default capacity, which is
this.tasks = new ArrayList<>();

Comment on lines +1 to +4
package duke.command;
import duke.TaskList;
import duke.Ui;
import duke.Storage;

Choose a reason for hiding this comment

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

Might want to put a whitespace like so :)

package duke.command;

import duke.TaskList;
import duke.Ui;
import duke.Storage;

Comment on lines +6 to +7
import duke.task.Task;
public class DeleteCommand extends Command {

Choose a reason for hiding this comment

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

Might want to add a whitespace here! :)

Comment on lines +12 to +13
}
@Override

Choose a reason for hiding this comment

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

Whitespace here too!

Comment on lines +7 to +8
import java.time.LocalDate;
public class EventCommand extends Command {

Choose a reason for hiding this comment

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

Whitespace here too! :)

Comment on lines +7 to +8


Choose a reason for hiding this comment

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

Suggested change

2 spaces here!

Comment on lines +13 to +14


Choose a reason for hiding this comment

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

Suggested change

2 spaces here! should be 1!

Comment on lines +6 to +7
import static org.junit.jupiter.api.Assertions.assertEquals;
public class ExitCommandTest {

Choose a reason for hiding this comment

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

Suggested change
import static org.junit.jupiter.api.Assertions.assertEquals;
public class ExitCommandTest {
import static org.junit.jupiter.api.Assertions.assertEquals;
public class ExitCommandTest {

Whitespace here too! :)

Comment on lines +1 to +10
deadline finish ip /by 2359
event lecture /from now /to later
list
todo survive one more day
mark 1
list
mark 3
unmark 3
list
bye

Choose a reason for hiding this comment

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

No need to push test files! Can gitignore! :)

Comment on lines +8 to +58
____________________________________________________________
Hello! I'm Duke
What can I do for you?
____________________________________________________________
____________________________________________________________
Got it. I've added this task:
[D][ ] finish ip (by: 2359)
Now you have 1 tasks in the list
____________________________________________________________
____________________________________________________________
Got it. I've added this task:
[E][ ] lecture (from: now to: later)
Now you have 2 tasks in the list
____________________________________________________________
____________________________________________________________
Here are the tasks in your list:
1.[D][ ] finish ip (by: 2359)
2.[E][ ] lecture (from: now to: later)
____________________________________________________________
____________________________________________________________
Got it. I've added this task:
[T][ ] survive one more day
Now you have 3 tasks in the list
____________________________________________________________
____________________________________________________________
Nice! I've marked this task as done:
[D][X] finish ip (by: 2359)
____________________________________________________________
____________________________________________________________
Here are the tasks in your list:
1.[D][X] finish ip (by: 2359)
2.[E][ ] lecture (from: now to: later)
3.[T][ ] survive one more day
____________________________________________________________
____________________________________________________________
Nice! I've marked this task as done:
[T][X] survive one more day
____________________________________________________________
____________________________________________________________
OK! I've marked this task as not done yet:
[T][ ] survive one more day
____________________________________________________________
____________________________________________________________
Here are the tasks in your list:
1.[D][X] finish ip (by: 2359)
2.[E][ ] lecture (from: now to: later)
3.[T][ ] survive one more day
____________________________________________________________
____________________________________________________________
Bye. Hope to see you again soon!
____________________________________________________________

Choose a reason for hiding this comment

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

No need to push test files! Can gitignore! :)

Refactored much of the code to make it more readable. Main
changes were removing nested if statements, refactoring them
into switch statements instead and removing unecessary string
builder instances from the UI class.
Assert that the title of the new tasks added match the
title passed to the respective method.
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.

None yet

2 participants