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

[PeterHW963] iP #641

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

Conversation

PeterHW963
Copy link

@PeterHW963 PeterHW963 commented Sep 3, 2024

Nether

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

Nether frees your mind of having to remember things you need to do. It's

  • text-based
  • easy to learn
  • FAST SUPER FAST to use

All you need to do is

  1. download it from here.
  2. double-click it.
  3. add your tasks.
  4. let it manage your tasks for you 😉

And it is FREE!

Features:

  • Managing tasks
  • Managing deadlines (coming soon)
  • Reminders (coming soon)

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

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

damithc and others added 30 commits July 11, 2024 16:52
In build.gradle, the dependencies on distZip and/or distTar causes
the shadowJar task to generate a second JAR file for which the
mainClass.set("seedu.duke.Duke") does not take effect.
Hence, this additional JAR file cannot be run.
For this product, there is no need to generate a second JAR file
to begin with.

Let's remove this dependency from the build.gradle to prevent the
shadowJar task from generating the extra JAR file.
Duke.java visually prints out "Duke"

The assignment given is to rename the chatbot, and create a greet and
exit message.

Let's rename the file to Nether.java, its new name and create the
greet and exit messages, along with a new visual print out of its name.

"println" statements are the only lines edited as that is the only
requirement for this increment.
Chatbot produces visual art of its name, greetings, and goodbye message
when run.

The assignment given is to have chatbot produce echo whenever the
user inputs anything other than "bye".

Let's create a Scanner object to receive user input and create an
infinite loop of echoing the user input and listening for more input. We
used a check inside the infinite loop for a "bye" input to break out of
the loop and produce the goodbye message.
Chatbot echoes user input unless the user inputs "bye"

The assignment given is to have the chatbot add whatever the user inputs
into a list of tasks and to add another check for the input "list", to
which the chatbot should return a numbered list of all the tasks the
user has input so far.

Let's create an array of size 100 to store the tasks input by user along
with a counter to keep track of the current index in the array. When
the user inputs "list", a for loop is used to iterate through the array
and print out the entries.

Additionally, an abstraction for printing the horizontal line output is
made and the constants MAX_TASKS, EXIT_COMMAND, and LIST_COMMAND were
created to improve reusability and readability.
Chatbot add whatever the user inputs into a list of tasks and prints a
numbered list of all the tasks the user has input so far whenever the
user inputs "list".

The assignment given is to have the chatbot have the ability to
mark/unmark tasks as done/not done when the user inputs "mark +
(integer)" or "unmark + (integer)".

Let's create a new class called Task to represent tasks. Task has a
description, index, and an isDone status. Task class also has the
necessary getters and setters. Next, let's implement an extra check for
the user input (i.e. if the user input starts with "mark" or "unmark")
that modifies the task object to be done or not done respectively.

Additionally, an abstraction for displaying the task list is
made and the constants MARK_AS_DONE and MARK_AS_NOT_DONE were
created to improve reusability and readability.

A new Task class was created to encapsulate the data and behavior of
task objects, improve reusability, maintainability, and readability.
Chatbot adds whatever the user inputs into a list of tasks and prints a
numbered list of all the tasks the user has input so far whenever the
user inputs "list" along with its done/not done status.

The assignment given is to have the chatbot have the ability to
recognize what type of task is added, whether it is ToDos, Deadline, or
Event type tasks and have the task type displayed when listing the
tasks.

Let's create new subclasses for the Task class to represent the 3 types
of tasks. DeadlineTask has a by attribute and EventTask has from and to
attributes. Each of these Task subclasses have their own constructor and
toString methods. Next, let's implement a method that parses the user
input into the correct number of parts to instantiate the respective
tasks with.

Inheritance was used to support multiple task types since the different
tasks have some similarity between them.
Chatbot adds one of the 3 types of tasks the user inputs into a
numbered list. The tasks can be marked as done or not done, and user can
input "list" to view all the tasks written so far.

The assignment given is to have the chatbot handle errors, especially
when the user enters an unexpected input that the chatbot is not
programmed to handle.

Let's create a new exception called NetherException that can produce the
corresponding error message. Additionally, an automated testing has been
implemented.
Chatbot adds one of the 3 types of tasks the user inputs into a
numbered list. The tasks can be marked as done or not done, and user can
input "list" to view all the tasks written so far. Chatbot can also
handle various inputs from the user.

The assignment given is to have the chatbot able to receive delete
commands to delete a task from the list.

Let's add an extra check to the chatbot for a "delete" command to then
remove the task from the list
Chatbot is initialized with a blank task list every time.

The assignment given is to have the chatbot able to save task list data
and load task list from existing data (if any) upon initialization.

Let's create a new Storage class that handles the saving and loading of
tasks from the data file. Also let's implement a method toSaveFormat
for each task type that processes the existing task list data into a
form that is easily processed later on for loading.
Chatbot can take any date and/or time format from user inputs.

The assignment given is to have the chatbot able to validate input
date/time and save task date/time using LocalDateTime. Additionally,
the toString() method should also present the date/time of tasks in a
more user-friendly way.

Let's make use of the LocalDateTime and DateTimeFormatter to parse user
date/time input, and later on, revert it into String when it needs to be
printed for users to see.
Build configuration for gradle is default (i.e. mainClass was the Duke
class)

Let's change the mainClass to be the nether.Nether class (specific to
my own iP)
@yyihaoc
Copy link

yyihaoc commented Sep 6, 2024

LGTM!

PeterHW963 and others added 29 commits September 6, 2024 15:11
A lot of checkstyle tests were failing.

Followed suggestions to correct all of them.
There is no special response message when the 'list' command is
input with an empty task list.

Creating a special response message makes the chatbot response more
realistic.

Let's create a guard case using an if statement to return a special
response string when 'list' is input with an empty task list.
Abnormal user input such as inputting an empty string has not been
handled.

Assertion for this particular input is implemented.

Let's use assert !Object.equals("", userInput) to then give the
appropriate error, though it will not appear in the GUI.
Code has lapses in following the Code Quality given in this week's
materials.

The principles below has been followed now:
- avoid long methods
- avoid deep nesting
- avoid complicated expressions
- avoid magic numbers
- make the code obvious
- structure code logically
- do not 'trip up' reader
- practice Keep it simple, stupid
- Single Level of Abstraction Principle
- Make the happy path prominent
- don't recycle variables or parameters
- use default branchs
- avoid empty catch blocks
- delete dead code
- Minimize scope of variables
- Minimize code duplication
Updated README and added exit functionality.
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