Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
f0ecd9c
add chatbot name
hongyijie06 Jan 26, 2024
e0b6eed
Add echo
hongyijie06 Feb 7, 2024
35ec609
add Add,list
hongyijie06 Feb 7, 2024
0c16724
add mark as done
hongyijie06 Feb 9, 2024
1b6ca15
add A-CodingStandard
hongyijie06 Feb 9, 2024
6ef3078
add todo, deadline and event
hongyijie06 Feb 16, 2024
b540106
add code quality
hongyijie06 Feb 19, 2024
c230255
add error handling
hongyijie06 Feb 20, 2024
bedc8ec
make error handling more error-specific
hongyijie06 Feb 20, 2024
4793c54
Revert "make error handling more error-specific"
hongyijie06 Feb 20, 2024
c43aef3
Revert "Revert "make error handling more error-specific""
hongyijie06 Feb 20, 2024
e0bf4a2
add delete
hongyijie06 Feb 20, 2024
7078d98
Merge branch 'branch-Level-6'
hongyijie06 Feb 22, 2024
4de283c
settle errors
hongyijie06 Feb 22, 2024
e44d14e
add save
hongyijie06 Feb 22, 2024
011c695
resolve errors
hongyijie06 Feb 22, 2024
0bc39f6
Merge branch 'branch-Level-7'
hongyijie06 Feb 22, 2024
b1fd82d
fix formatting when listing tasks
hongyijie06 Mar 2, 2024
61216db
add saveToFile
hongyijie06 Mar 2, 2024
996ba2b
fix file not found error
hongyijie06 Mar 3, 2024
7162ac7
use more oop
hongyijie06 Mar 6, 2024
7a5826c
fix loading file errors
hongyijie06 Mar 6, 2024
4a60dbe
add find
hongyijie06 Mar 7, 2024
422ac12
Merge branch 'branch-Level-9'
hongyijie06 Mar 7, 2024
2152ef7
add javadoc
hongyijie06 Mar 7, 2024
b611a02
Merge pull request #1 from hongyijie06/branch-A-JavaDoc
hongyijie06 Mar 7, 2024
d141099
Merge branch 'master' of https://github.com/hongyijie06/ip
hongyijie06 Mar 7, 2024
6752306
Add user guide
hongyijie06 Mar 7, 2024
2f4b481
Format headers
hongyijie06 Mar 7, 2024
4f03af2
follow coding standards
hongyijie06 Mar 8, 2024
fbcc37c
add README pictures
hongyijie06 Mar 8, 2024
456bcb0
add pictures
hongyijie06 Mar 8, 2024
dc9a769
improve formatting, no pictures
hongyijie06 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
155 changes: 131 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,131 @@
# 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
____ _
| _ \ _ _| | _____
| | | | | | | |/ / _ \
| |_| | |_| | < __/
|____/ \__,_|_|\_\___|
```
# User Guide for chatbot "Apple"

Chatbot Apple is an app to manage tasks, optimised for use through a Command Line Interface (CLI).

## Quick Start
1. Ensure Java 11 or above is installed in your computer
2. Download `ip.jar` from [here](https://github.com/hongyijie06/ip/releases/tag/A-Jar)
3. Open a command terminal, `cd` into the folder with the jar file and use the `java -jar ip.jar` command to run the application.

A CLI similar to the picture below should appear in a few seconds. Note how the app returns the path to which the list of tasks is saved on the local computer.

4. Type the command into the command line and press Enter to execute it. e.g. typing list and pressing Enter will list the current tasks.
Some example commands you can try:

- `todo tutorial`: Adds task "tutorial" to the list
- `deadline return book by 4pm`: Adds task "return book" nd deadline "4pm" to the list
- `list`: Lists all tasks
- `bye`: Exits the app

5. Refer to the Features below for more details on each command.

## Features

[!NOTE]
> Words in `UPPER_CASE` are parameters to be supplied by the user. e.g. in `delete INDEX`, `INDEX` is a parameter which can be used as `delete 3`

## Listing tasks: `list`
Lists all tasks in the task list.

Format: `list`

## Add tasks
### Add todo : `todo`
Adds task of type todo to the list of tasks

Format: `todo DESCRIPTION`

Examples:
- `todo tutorial` Adds task `tutorial` to the list of tasks
- `todo watch lecture` Adds task `watch lecture` to the list of tasks

ADD PIC HERE

### Add deadline: `deadline`
Adds task of type deadline to the list of tasks

Format: `deadline DESCRIPTION by DEADLINE`

Examples:
- `deadline return book by 4pm` Adds task `return book` with deadline `4pm` to the list of tasks
- `deadline submit report by 7pm` Adds task `submit report` with deadline `7pm` to the list of tasks

ADD PIC HERE

### Add event: `event`
Adds task of type event to the list of tasks

Format: `event DESCRIPTION from START to END`

Examples:
- `event Math exam from 2pm to 4pm` Adds task `Math exam` with timeline `2pm` to `4pm` to the list of tasks
- `event project group meeting from 11am to 1pm` Adds task `project group meeting` with timeline `11am` to `1pm` to the list of tasks

ADD PIC HERE

## Delete tasks: `delete`
Deletes task from the list of tasks

Format: `delete INDEX`

- Deletes task at the specified `INDEX`.
- The index refers to the index of the task in the list of tasks.
- The index must be a positive integer.

Examples:
- `delete 3` Deletes third task in the list
- `delete 5` Deletes fifth task in the list

## Mark tasks as done: `mark`
Marks tasks as completed

Format: `mark INDEX`

- Marks task as done at the specified `INDEX`.
- The index refers to the index of the task in the list of tasks.
- The index must be a positive integer.

Examples:
- `mark 1` Marks first task in the list as done
- `mark 6` Marks sixth task in the list as done

## Unmark tasks: `unmark`
Marks tasks as undone

Format: `unmark INDEX`

- Marks task as not done at the specified `INDEX`.
- The index refers to the index of the task in the list of tasks.
- The index must be a positive integer.

Examples:
- `unmark 1` Marks first task in the list as notdone
- `unmark 2` Marks second task in the list as not done

## Find Keywords: `find`
Filters list of tasks to those containing the keyword the user wants to find

Format: `find KEYWORD`

Examples:
- `find book` CLI returns a list with all the tasks with the `KEYWORD` `book`.
- `find tutorial` CLI returns a list with all the tasks with the `KEYWORD` `tutorial`.

## Exit app: `bye`
Exits the chatbot

Format: `bye`

## Command Summary

| Command | Format, Examples |
| ------- | --------------- |
| `list` | `list` |
| `todo` | `todo DESCRIPTION` e.g. `todo tutorial` |
| `deadline` | `deadline DESCRIPTION by DEADLINE` e.g. `deadline return book by 4pm` |
| `event` | `event DESCRIPTION from START to END` e.g. `event Math exam from 2pm to 4pm` |
| `delete` | `delete INDEX` e.g. `delete 3` |
| `mark` | `mark INDEX` e.g. `mark 2` |
| `unmark` | `unmark INDEX` e.g. `unmark 1` |
| `find` | `find KEYWORD` e.g. `find book` |
| `bye` | `bye` |
125 changes: 109 additions & 16 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,122 @@
# User Guide
# User Guide for chatbot "Apple"

## Features
Chatbot Apple is an app to manage tasks, optimised for use through a Command Line Interface (CLI).

### Feature-ABC
## Quick Start
1. Ensure Java 11 or above is installed in your computer
2. Download `ip.jar` from [here](https://github.com/hongyijie06/ip/releases/tag/A-Release)
3. Open a command terminal, `cd` into the folder with the jar file and use the `java -jar ip.jar` command to run the application.
4. Type the command into the command line and press Enter to execute it. e.g. typing list and pressing Enter will list the current tasks.
Some example commands you can try:

Description of the feature.
- `todo tutorial`: Adds task "tutorial" to the list
- `deadline return book by 4pm`: Adds task "return book" nd deadline "4pm" to the list
- `list`: Lists all tasks
- `bye`: Exits the app

### Feature-XYZ
5. Refer to the Features below for more details on each command.

Description of the feature.
## Features

## Usage
[!NOTE]
> Words in `UPPER_CASE` are parameters to be supplied by the user. e.g. in `delete INDEX`, `INDEX` is a parameter which can be used as `delete 3`

### `Keyword` - Describe action
## Add tasks
### Add todo : `todo`
Adds task of type todo to the list of tasks

Describe the action and its outcome.
Format: `todo DESCRIPTION`

Example of usage:
Examples:
- `todo tutorial` Adds task `tutorial` to the list of tasks
- `todo watch lecture` Adds task `watch lecture` to the list of tasks

`keyword (optional arguments)`
### Add deadline: `deadline`
Adds task of type deadline to the list of tasks

Expected outcome:
Format: `deadline DESCRIPTION by DEADLINE`

Description of the outcome.
Examples:
- `deadline return book by 4pm` Adds task `return book` with deadline `4pm` to the list of tasks
- `deadline submit group report by 7pm` Adds task `submit group report` with deadline `7pm` to the list of tasks

```
expected output
```
### Add event: `event`
Adds task of type event to the list of tasks

Format: `event DESCRIPTION from START to END`

Examples:
- `event Math exam from 2pm to 4pm` Adds task `Math exam` with timeline `2pm` to `4pm` to the list of tasks
- `event project group meeting from 11am to 1pm` Adds task `project group meeting` with timeline `11am` to `1pm` to the list of tasks

## Listing tasks: `list`
Lists all tasks in the task list.

Format: `list`

## Mark tasks as done: `mark`
Marks tasks as completed

Format: `mark INDEX`

- Marks task as done at the specified `INDEX`.
- The index refers to the index of the task in the list of tasks.
- The index must be a positive integer.

Examples:
- `mark 1` Marks first task in the list as done
- `mark 3` Marks sixth task in the list as done

## Unmark tasks: `unmark`
Marks tasks as undone

Format: `unmark INDEX`

- Marks task as not done at the specified `INDEX`.
- The index refers to the index of the task in the list of tasks.
- The index must be a positive integer.

Examples:
- `unmark 1` Marks first task in the list as not done
- `unmark 2` Marks second task in the list as not done

## Find Keywords: `find`
Filters list of tasks to those containing the keyword the user wants to find

Format: `find KEYWORD`

Examples:
- `find book` CLI returns a list with all the tasks with the `KEYWORD` `book`.
- `find group` CLI returns a list with all the tasks with the `KEYWORD` `group`.

## Delete tasks: `delete`
Deletes task from the list of tasks

Format: `delete INDEX`

- Deletes task at the specified `INDEX`.
- The index refers to the index of the task in the list of tasks.
- The index must be a positive integer.

Examples:
- `delete 3` Deletes third task in the list
- `delete 5` Deletes fifth task in the list

## Exit app: `bye`
Exits the chatbot

Format: `bye`

## Command Summary

| Command | Format, Examples |
| ------- | --------------- |
| `todo` | `todo DESCRIPTION` e.g. `todo tutorial` |
| `deadline` | `deadline DESCRIPTION by DEADLINE` e.g. `deadline return book by 4pm` |
| `event` | `event DESCRIPTION from START to END` e.g. `event Math exam from 2pm to 4pm` |
| `list` | `list` |
| `mark` | `mark INDEX` e.g. `mark 2` |
| `unmark` | `unmark INDEX` e.g. `unmark 1` |
| `find` | `find KEYWORD` e.g. `find book` |
| `delete` | `delete INDEX` e.g. `delete 3` |
| `bye` | `bye` |
Binary file added production/main/CreateFile.class
Binary file not shown.
Binary file added production/main/Deadline.class
Binary file not shown.
Binary file added production/main/Duke.class
Binary file not shown.
Binary file added production/main/EmptyLineException.class
Binary file not shown.
Binary file added production/main/Event.class
Binary file not shown.
Binary file added production/main/ManageInputs.class
Binary file not shown.
Binary file added production/main/ReadFileContents.class
Binary file not shown.
Binary file added production/main/Task.class
Binary file not shown.
Binary file added production/main/Todo.class
Binary file not shown.
Binary file added production/main/UnexpectedCommandException.class
Binary file not shown.
8 changes: 8 additions & 0 deletions src/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/.idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions src/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions src/TaskList.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[T][0] hike
[T][0] run
[D][0] tut (by: 5)
[E][0] he (from: 5 to: 6)
[T][0] jump
[T][0] go
[D][0] hop (by: 4)
[E][0] he (from: 4 to: 5)
[D][0] b (by: 4)
[E][0] go (from: 4 to: 454)
[T][0] ds
[D][0] kj (by: 4)
[T][0] he
[E][0] f (from: 4 to: 5)
[D][0] sd (by: 5)
[D][0] hsd (by: 343354535)
33 changes: 33 additions & 0 deletions src/main/java/CreateFile.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import java.io.File;
import java.io.IOException;

/**
* creates local TaskList.txt file on the local machine
*/
public class CreateFile {
protected static Ui ui;
public static void CreateFile() {
File file = new File("TaskList.txt");
String errorDescription;
String fileStatus;

if (!file.exists()) {
try {
if (file.createNewFile()) {
fileStatus = "File created";
System.out.println(fileStatus + ": " + file.getAbsolutePath());
} else {
errorDescription = "File creation failed.";
ui.errorMessage(errorDescription);
}
} catch (IOException e) {
errorDescription = "An I/O error occurred.";
ui.errorMessage(errorDescription);
e.printStackTrace();
}
} else {
fileStatus = "File already exists";
System.out.println(fileStatus + ": " + file.getAbsolutePath());
}
}
}
Loading