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

[Ranj Nicoli M. Negapatan] iP #177

Open
wants to merge 36 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
0775ed9
step one
nicknamenic Jan 25, 2024
8fe8911
step one point five
nicknamenic Jan 25, 2024
318b7c8
test class
nicknamenic Jan 25, 2024
2928ccd
deleted test class
nicknamenic Jan 25, 2024
0ff2890
Level 0
nicknamenic Jan 25, 2024
9109f7b
Level 0
nicknamenic Feb 6, 2024
b1b8451
Level 1
nicknamenic Feb 7, 2024
4dbe8cc
Create chatbot
nicknamenic Feb 15, 2024
a97a39d
Create Nocturne
nicknamenic Feb 15, 2024
2ac814f
Increment Level
nicknamenic Feb 15, 2024
eacad45
Increment Level
nicknamenic Feb 15, 2024
09a5d4f
Increment to Level 3
nicknamenic Feb 15, 2024
a471735
Adhering to Coding Standards
nicknamenic Feb 15, 2024
9a83d8b
Increment to Level 4
nicknamenic Feb 15, 2024
e112fa9
Coding Quality Update
nicknamenic Feb 15, 2024
dcdc7f7
Increment to Level-5
nicknamenic Feb 15, 2024
bb8a3e6
Added an exception class, NocturneException
nicknamenic Feb 15, 2024
bf6f1e3
Increment to Level 5, and added NocturneException Class
nicknamenic Feb 15, 2024
d3102fb
Already added NocturneException, so committing an extra to tag as A-E…
nicknamenic Feb 15, 2024
5fd17b8
Added extra exceptions
nicknamenic Feb 15, 2024
15a1d1d
Merge pull request #1 from nicknamenic/branch-Level-5
nicknamenic Feb 15, 2024
5e7eae3
Minor adjustment
nicknamenic Feb 21, 2024
8b28a80
Refactored and Incremented to Level 6
nicknamenic Mar 8, 2024
0c8f0ae
Merge pull request #2 from nicknamenic/branch-Level-5
nicknamenic Mar 8, 2024
215cd8e
Merge pull request #3 from nicknamenic/branch-Level-6
nicknamenic Mar 8, 2024
99801a2
Increment to Level 7
nicknamenic Mar 8, 2024
445a861
Merge branch 'master' into branch-Level-7
nicknamenic Mar 8, 2024
47e5965
Merge pull request #4 from nicknamenic/branch-Level-7
nicknamenic Mar 8, 2024
6516db0
Increment to Level 7
nicknamenic Mar 8, 2024
9f18a5a
Increment to Level 9
nicknamenic Mar 8, 2024
7ad7424
Merge pull request #5 from nicknamenic/branch-Level-9
nicknamenic Mar 8, 2024
b473729
JavaDoc Increment
nicknamenic Mar 8, 2024
c841e23
Merge pull request #6 from nicknamenic/branch-Level-9
nicknamenic Mar 8, 2024
dba37e0
A-UserGuide
nicknamenic Mar 8, 2024
2d9bd79
Merge pull request #7 from nicknamenic/branch-Level-9
nicknamenic Mar 8, 2024
3983129
A-UserGuide
nicknamenic Mar 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 61 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,61 @@
# Duke project template

This is a project template for a greenfield Java project. It's named after the Java mascot _Duke_. Given below are instructions on how to use it.

## Setting up in Intellij

Prerequisites: JDK 11, update Intellij to the most recent version.

1. Open Intellij (if you are not in the welcome screen, click `File` > `Close Project` to close the existing project first)
1. Open the project into Intellij as follows:
1. Click `Open`.
1. Select the project directory, and click `OK`.
1. If there are any further prompts, accept the defaults.
1. Configure the project to use **JDK 11** (not other versions) as explained in [here](https://www.jetbrains.com/help/idea/sdk.html#set-up-jdk).<br>
In the same dialog, set the **Project language level** field to the `SDK default` option.
3. After that, locate the `src/main/java/Duke.java` file, right-click it, and choose `Run Duke.main()` (if the code editor is showing compile errors, try restarting the IDE). If the setup is correct, you should see something like the below as the output:
```
Hello from
____ _
| _ \ _ _| | _____
| | | | | | | |/ / _ \
| |_| | |_| | < __/
|____/ \__,_|_|\_\___|
```
# Nocturne v0.2

Welcome to the User Guide for Nocturne.

![The eternal nightmare... Now a servant?](https://pbs.twimg.com/media/E4FchwcVIAIfb4h?format=jpg&name=4096x4096)

## Setting up the ChatBot

Ensure that you have the ip.jar file downloaded. Take note of which directory this file is located. A convenient location would be in Downloads, or the Desktop.

Now, open up the command prompt. You can do this by pressing the Windows key and searching 'Command Prompt'. For Mac users, you can press 'Command + Space' to open up the search bar. From there you can open the Terminal by searching for it on the search bar.

Once in the terminal, type in *cd Downloads* or *cd Desktop*. This will place you in the directory where you placed Nocturne. Now, simply type
> java -jar ip.jar

And this will initialize Nocturne.

## Nocturne's Features

Primarily, Nocturne is there to help you record tasks you need to do, as well as their completion status. To utilize them, you will need to enter the commands below. In particular, keep the commands in lowercase, and as much as possible, do not deviate from the command structure. Error messages will be thrown at you if you mess up, but not to worry, Nocturne will usually tell you what you did wrong.

For the features below, Words in UPPER_CASE are the parameters to be supplied by the user.
e.g. in *todo TASK*, *TASK* is a parameter which can be used as *todo pay the bills*.

### Adding a Todo task: **todo STRING**
Adds a Todo task to the list.
For example: >*todo do the laundry*

### Adding a deadline task: **deadline STRING /by TIME**
Adds a deadline to the list.
For example: >*deadline return books /by Friday 5pm*

### Adding an event task: **event STRING /from START /to END**
Adds an event to the list.
For example: >*event Brian's birthday /from Saturday 2pm /to Saturday 10pm

### Marking a task as complete: **mark NUMBER**
Marks a task as complete.
For example: >*mark 2*

### Marking a task as incomplete: **unmark NUMBER**
Marks a task as incomplete.
For example: >*unmark 2*

### Deleting a task: **delete NUMBER**
Deletes a task already on the list.
For example: >*delete 1*

### Finding a task: **find KEYWORD**
Finds any tasks that have your keyword and shows them to you. Does not include the TIME, START or END inputs from deadline or event.
For example: >*find swim*

### Listing all tasks: **list**
Lists all the tasks you have accummulated thus far, showing them in a numbered list, displaying their type (T for Todo, D for deadline and E for event) as well as their completion status.

### Closing the bot: **bye**
Causes the bot to exit.

Be aware that running the bot in the first place creates a text file, nocturne.txt, within the directory that your ip.jar file is placed in. This holds all of the tasks that you have inputted, which Nocturne will remember on startup once again. There is no need for manual saving, as Nocturne updates it every time you add, delete or mark tasks.

Thank you for using Nocturne.
64 changes: 48 additions & 16 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,61 @@
# User Guide
# Nocturne v0.2

## Features
Welcome to the User Guide for Nocturne.

### Feature-ABC
![The eternal nightmare... Now a servant?](https://pbs.twimg.com/media/E4FchwcVIAIfb4h?format=jpg&name=4096x4096)

Description of the feature.
## Setting up the ChatBot

### Feature-XYZ
Ensure that you have the ip.jar file downloaded. Take note of which directory this file is located. A convenient location would be in Downloads, or the Desktop.

Description of the feature.
Now, open up the command prompt. You can do this by pressing the Windows key and searching 'Command Prompt'. For Mac users, you can press 'Command + Space' to open up the search bar. From there you can open the Terminal by searching for it on the search bar.

## Usage
Once in the terminal, type in *cd Downloads* or *cd Desktop*. This will place you in the directory where you placed Nocturne. Now, simply type
> java -jar ip.jar

### `Keyword` - Describe action
And this will initialize Nocturne.

Describe the action and its outcome.
## Nocturne's Features

Example of usage:
Primarily, Nocturne is there to help you record tasks you need to do, as well as their completion status. To utilize them, you will need to enter the commands below. In particular, keep the commands in lowercase, and as much as possible, do not deviate from the command structure. Error messages will be thrown at you if you mess up, but not to worry, Nocturne will usually tell you what you did wrong.

`keyword (optional arguments)`
For the features below, Words in UPPER_CASE are the parameters to be supplied by the user.
e.g. in *todo TASK*, *TASK* is a parameter which can be used as *todo pay the bills*.

Expected outcome:
### Adding a Todo task: **todo STRING**
Adds a Todo task to the list.
For example: >*todo do the laundry*

Description of the outcome.
### Adding a deadline task: **deadline STRING /by TIME**
Adds a deadline to the list.
For example: >*deadline return books /by Friday 5pm*

```
expected output
```
### Adding an event task: **event STRING /from START /to END**
Adds an event to the list.
For example: >*event Brian's birthday /from Saturday 2pm /to Saturday 10pm

### Marking a task as complete: **mark NUMBER**
Marks a task as complete.
For example: >*mark 2*

### Marking a task as incomplete: **unmark NUMBER**
Marks a task as incomplete.
For example: >*unmark 2*

### Deleting a task: **delete NUMBER**
Deletes a task already on the list.
For example: >*delete 1*

### Finding a task: **find KEYWORD**
Finds any tasks that have your keyword and shows them to you. Does not include the TIME, START or END inputs from deadline or event.
For example: >*find swim*

### Listing all tasks: **list**
Lists all the tasks you have accummulated thus far, showing them in a numbered list, displaying their type (T for Todo, D for deadline and E for event) as well as their completion status.

### Closing the bot: **bye**
Causes the bot to exit.

Be aware that running the bot in the first place creates a text file, nocturne.txt, within the directory that your ip.jar file is placed in. This holds all of the tasks that you have inputted, which Nocturne will remember on startup once again. There is no need for manual saving, as Nocturne updates it every time you add, delete or mark tasks.

Thank you for using Nocturne.
10 changes: 0 additions & 10 deletions src/main/java/Duke.java

This file was deleted.

3 changes: 3 additions & 0 deletions src/main/java/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Manifest-Version: 1.0
Main-Class: Nocturne

17 changes: 17 additions & 0 deletions src/main/java/Nocturne.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import exceptions.NocturneException;
import util.Parser;
import util.TaskList;
import util.Ui;

public class Nocturne {

/**
* The main function of the Chatbot, Nocturne.
*/
public static void main(String[] args) {
TaskList list = new TaskList();
Ui.greetingMessage();
Parser.getInput(list);
Ui.farewellMessage();
}
}
7 changes: 7 additions & 0 deletions src/main/java/exceptions/NocturneException.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package exceptions;

public class NocturneException extends Exception {
public NocturneException(String s) {
super(s);
}
}
45 changes: 45 additions & 0 deletions src/main/java/tasks/Deadline.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package tasks;

/**
* Deadline subclass of Task. Requiring a by input.
*/
public class Deadline extends Task {
protected String by;

/**
* Constructor for the deadline object.
*
* @param description The description of the deadline.
* @param by The due date of the deadline.
*/
public Deadline(String description, String by) {
super(description);
this.by = by;
}

/**
* Constructor for the deadline object when reconstructing the list
* from nocturne.txt, which includes the completion status of the deadline.
*
* @param description The description of the deadline.
* @param by The due date of the deadline.
* @param isDone The boolean variable of whether the deadline is done or not.
*/
public Deadline(String description, String by, boolean isDone) {
super(description);
this.by = by;
this.isDone = isDone;
}

/**
* Override of the deadline class when it is printed,
* resulting in the format shown in the list.
*
* @return The string that will be printed.
*/
@Override
public String toString() {
return "[D]" + "[" + super.getStatusIcon() + "] " + this.description + " (by: " + by + ")";
}
}

51 changes: 51 additions & 0 deletions src/main/java/tasks/Event.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package tasks;

/**
* Event subclass of Task. Requires a from and to input.
*/
public class Event extends Task {
protected String from;
protected String to;

/**
* Constructor for the event object.
*
* @param description The description of the event.
* @param from The start time of the event.
* @param to The end time of the event.
*/
public Event(String description, String from, String to) {
super(description);
this.from = from;
this.to = to;
}

/**
* Constructor for event when restructuring the list from
* nocturne.txt, which includes the completion status of the event.
*
* @param description The description of the event.
* @param from The start time of the event.
* @param to The end time of the event.
* @param isDone The boolean variable of whether the event is done or not.
*/
public Event(String description, String from, String to, boolean isDone) {
super(description);
this.from = from;
this.to = to;
this.isDone = isDone;
}

/**
* Override of the event class when printed,
* resulting in the format shown in the list.
*
* @return The string that will be printed.
*/
@Override
public String toString() {
return "[E][" + super.getStatusIcon() +
"] " + this.description +
" (from: " + this.from + " to: " + this.to + ")";
}
}
51 changes: 51 additions & 0 deletions src/main/java/tasks/Task.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package tasks;

/**
* The base class of deadline, event and todo.
*/
public class Task {
protected String description;
protected boolean isDone;

/**
* Constructor for the task object.
*
* @param description The description of the task.
*/
public Task(String description) {
this.description = description;
this.isDone = false;
}

/**
* The string showing the completion status of the task.
*
* @return X when the task is completed, one blank space otherwise.
*/
public String getStatusIcon() {
return (isDone ? "X" : " ");
}

/**
* Marks a task as done.
*/
public void markAsDone() {
this.isDone = true;
}

/**
* Marks a task as not done.
*/
public void markAsUndone() {
this.isDone = false;
}

/**
* Gets the description of a task.
*
* @return The description of a task.
*/
public String getDescription() {
return this.description;
}
}
Loading