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

[Joshua Chiang] iP #374

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

Conversation

ChickenChiang
Copy link

@ChickenChiang ChickenChiang commented Jan 31, 2023

Cluck! 🐔

“Your mind is for having ideas, not holding them.” – David Allen (source)

Cluck! helps you keep track of your tasks, so you can go about your day by putting all your eggs in one basket.

  • text-based
  • easy to use
  • fun and interactive
  • Faster than a chicken can cross the road! :

All you need to do is:

  1. Download it here
  2. Start running Cluck!
  3. Add your tasks
  4. Let Cluck! handle the rest

Did we mention it was FREE?!

Features:

  • Managing Task
  • Find Tasks
  • Sort by date (coming soon!)

If you Java programmer, you can use it to practice Java too. Here's the main method:

public class Main {
    public static void main(String[] args) {
        new Cluck("Your_File_Directory_Here").run();
    }
}

damithc and others added 12 commits July 31, 2022 17:20
Implement a skeletal version of Cluck that starts by greeting the user, simply echos commands entered by the user, and exits when the user types bye.
…tion, 2. Deadlines with description and due date, 3. Events with description, start and end time
Use the input/output redirection technique to semi-automate the testing of Duke(or rather, CLUCK)
Adding exception classes to handle errors by Duke
Now you can delete tasks from the todo list with Cluck. Tasks are also now stored in an ArrayList.
Copy link

@Jun-How Jun-How left a comment

Choose a reason for hiding this comment

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

In terms of coding standard, it looks mostly fine, except a few naming issues and unnecessary white spaces.
Some improvements requested below.

Comment on lines 7 to 12
static private final String MAKE_DEADLINE = "deadline";
static private final String MAKE_TODO = "todo";
static private final String MAKE_EVENT = "event";
static private final String DUE_DATE_FLAG = "/by ";
static private final String EVENT_START_FLAG = "/from ";
static private final String EVENT_END_FLAG = "/to ";
Copy link

Choose a reason for hiding this comment

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

Should the "static" keyword come before the access modifier ("private" in this case)?
private static final might be the preferred format.

Namings align with the coding standard, which is great!

Comment on lines 11 to 13
return this.isMarked
? String.format("[D][X] %1$s (by: %2$s)", this.description, this.dueDate)
: String.format("[D][ ] %1$s (by: %2$s)", this.description, this.dueDate);
Copy link

Choose a reason for hiding this comment

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

Could this method make use of abstraction so that the toString() method in the parent class Task could be used here? Then, you would only need to add the correct task icon ("D" for Deadline here) and the due date, making it easier to read.

Comment on lines 39 to 40
boolean loop = true;
List<Task> toDoList = new ArrayList<>();
Copy link

Choose a reason for hiding this comment

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

Perhaps a better name could be used for the boolean name sound more like a boolean. toDoList could also be renamed to be more specific and descriptive of a container of multiple tasks.

Suggested change
boolean loop = true;
List<Task> toDoList = new ArrayList<>();
boolean isActive = true;
List<Task> tasks = new ArrayList<>();

Comment on lines 13 to 15
return this.isMarked
? String.format("[E][X] %1$s (from:%2$s to:%3$s)", this.description, this.startTime, this.endTime)
: String.format("[E][ ] %1$s (from:%2$s to:%3$s)", this.description, this.startTime, this.endTime);
Copy link

Choose a reason for hiding this comment

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

Similar to the comment under Deadline, perhaps this could make use of the toString() method in the parent class Task?

src/main/java/Duke.java Outdated Show resolved Hide resolved
System.out.println(" ____________________________________________________________");
System.out.println(" You gotta give me a command!");
System.out.println(" ____________________________________________________________");

Copy link

Choose a reason for hiding this comment

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

Perhaps remove unnecessary white spaces between lines of code, such as within the switch statement? So that the format is standardised. This applies to some parts above too.

Copy link

@adam07018 adam07018 left a comment

Choose a reason for hiding this comment

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

Overall code is clean and nice

static private final String EVENT_END_FLAG = "/to ";

public static boolean isNumeric(String strNum) {
if (strNum == null) {

Choose a reason for hiding this comment

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

Love your code! Tidy and clean

Integer itemNumber = Integer.parseInt(words[1]);
if (itemNumber > toDoList.size() || itemNumber <= 0) {
System.out.println(" ____________________________________________________________");
System.out.println(" That's not...? In the list...? Buh caw?");

Choose a reason for hiding this comment

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

Interesting and Creative ui design

Scanner sc = new Scanner(System.in);

while (loop) {
String input = sc.nextLine();

Choose a reason for hiding this comment

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

Should we add a sc.close() at the end

ChickenChiang and others added 16 commits February 7, 2023 12:49
Making the Task class abstract ensures that it cannot be instantiated.

The new makeSaveFormat() function is an abstract method in Task, and it is overridden in each child class such that it returns a string that is formatted with respect to the child class for saving tasks.
Now the tasks in the todo list are saved into a txt file with consistent formmating with respect to the type of task.
It also captures the status of the task, whether or not it is marked or unmarked.
Save the tasks in the hard disk automatically whenever the task list changes. Load the data from the hard disk when Cluck starts up.
…e and restructure of package

Instead of saving the due dates of deadlines as strings they are now LocalDateTime objects which uses the java.time.LocalDateTime package
Added support for gradle to the project as well as denpendencies and tests
# Conflicts:
#	src/main/java/Deadline.java
#	src/main/java/Tasks/Task.java
# Conflicts:
#	src/main/java/Deadline.java
#	src/main/java/Tasks/Task.java
# Conflicts:
#	src/main/java/Tasks/Task.java
Added Exceptions for better exception handling
To allow for better OOP and more packages down the line, the files have been renamed and restructured.
TaskList is created to handle task operations.

TaskIndexOutOfBoundsException is thrown when a given index is out of the range of the taskList
TaskNotFoundException is thrown when a task is not found within a taskList (function that throws this is yet to be implemented)
The Cluck!.jar now creates a directory and a text file that saves the tasks of the user
# Conflicts:
#	src/main/java/cluck/Cluck.java
#	src/main/java/cluck/storage/Storage.java
Previous implementation to allow for more flexble parsing of date time given by the user cause some problems. In the previous commit I added optional patterns to allow for user to input various forms of date time, e.g. the user can input either 06, Jun, or June for a date on june. The user also has the option to omit the century of the year (i.e. the "20" in "2023") or minute of the time.

The change in FORMATTER in the task class cause the toString() and makeSaveFormat() methods in Event and Deadline classes to format the LocalDateTime classes into the wrong format, as the FORMATTER's optional patterns are all used to format the LocalDateTime, resulting in strange date strings like "21 03MarMarc 202323 1200".

To resolve the issue, I added an additional formatter by the name of default formatter where the DateTimeFormatter does not have optional patterns, and thus gives us consistent and correct string formats of the date when used by toString() and makeSaveFormat() methods.
User guide now contains additional information about the newly added date time format
This class was a feature that was in progress, not to be committed in master
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.

3 participants