Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
fc8a985
Level-0 Greeting
striris Feb 3, 2022
14b2a53
Level 1. Greet, Echo, Exit
striris Feb 3, 2022
6e9acc1
Level 2. Add, List
striris Feb 3, 2022
96dc870
deleted unnecessary package.
striris Feb 3, 2022
91a1e1d
Level 3. Mark as Done
striris Feb 3, 2022
ce07e46
Level 4. ToDos, Events, Deadlines
striris Feb 3, 2022
c1137e8
add a new line at the end of file
striris Feb 18, 2022
b1e49b1
Merge branch 'branch-Level-5'
striris Feb 18, 2022
409d603
created a package
striris Feb 18, 2022
3a3855f
created the jar file
striris Feb 20, 2022
315b905
changed array to ArrayList<Task>. added deletion function. extracted …
striris Feb 20, 2022
0d2eeca
Merge branch 'branch-Level-6'
striris Feb 20, 2022
7632f81
added saveTasks function to convert the list into a text file.
striris Feb 20, 2022
b18486b
added load/save file functions. organized tasks into a package.
striris Mar 2, 2022
94aca1f
A-MoreOOP added TaskList, changed FileManager to Storage, Added Ui.
striris Mar 3, 2022
c04f768
Give users a way to find a task by searching for a keyword. used Ui t…
striris Mar 3, 2022
12a5cb3
Merge pull request #1 from striris/branch-Level-9
striris Mar 3, 2022
a583454
Added Java doc.
striris Mar 3, 2022
0ada8a3
Added User Guide in README.md
striris Mar 3, 2022
d5cfae6
Set theme jekyll-theme-dinky
striris Mar 3, 2022
d37e926
code quality
striris Mar 3, 2022
b15dc81
Merge branch 'master' of https://github.com/striris/ip
striris Mar 3, 2022
b86f4ab
deleted Main class because it's reductant.
striris Mar 3, 2022
2b642be
minor changes
striris Mar 4, 2022
b10c45c
modified user guide
striris Mar 4, 2022
d497326
added try and catch
striris Mar 4, 2022
0198f4c
Used Ui to print error messages.
striris Mar 22, 2022
6204347
change if statement to switch statement and fixed the event without s…
striris Mar 22, 2022
64fc037
Modified the code such that the file will get updated after every Com…
striris Mar 22, 2022
7da23ce
Added more JavaDoc for functions and classes
striris Mar 22, 2022
18e39e7
Fixed number format bug for delete and mark function.
striris Mar 22, 2022
ae479ff
Made it compulsary to have description for each task.
striris Mar 22, 2022
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
160 changes: 136 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,136 @@
# 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
Duke is a **desktop app for tracking tasks,
optimized for use via a Command Line Interface** (CLI).
As Duke is designed to be use in a CLI, this
application would benefit users who are able to type fast.

## Quick Start
1. Ensure you have Java 11 or above installed on your Computer
2. Download the latest JAR file from GitHub.
3. Copy the file to the folder you want to use as the home folder for your Duke application.
Note that the data file would also be created in the same folder.
4. Open the CLI at where you have placed the jar file and run it using the command
`java -jar ip.jar`
5. Type the commands in the box and press enter to execute it.
Here are some commands you can try:
- `list` : List all current tasks.
- `todo Read Book` : Adds a todo task of reading book.
- `delete 1` : Deletes the first task from list.
### Feature list:
* Listing all tasks: `list`
* Adding a new task:
* Todo task: `todo`
* Deadline task: `deadline`
* Event task: `event`
* Marking a task as done: `mark`
* Marking a task as not done: `unmark`
* Deleting a task: `delete`
* Finding a task: `find`
* Exiting the program: `bye`

## Feature
### Adding a Task
There are three kinds of Tasks: Todos, Deadlines, and Events.
### Adding a Todo
Adds a Todo to the list of tasks. <br />
Format: `todo DESCRIPTION` <br />
Words in `UPPER_CASE` are the parameters. <br />
Examples:
* todo buy sunscreen
* todo buy bubble tea

### Adding a Deadline
Adds a Deadline to the list of tasks. <br />
Format: `deadline DESCRIPTION /by DEADLINE` <br />
Words in `UPPER_CASE` are the parameters. <br />
Examples: <br />
* deadline finish econometrics problem set /by Saturday
* deadine return book /by Sunday 12:30PM

### Adding an Event
Adds an Event to the list of tasks. <br />
Format: `event DESCRIPTION /at TIME` <br />
Words in `UPPER_CASE` are the parameters. <br />
Examples: <br />
* event project meeting /at Saturday 8:00PM
* event attend CS2113 lecture /at Friday 4:00PM

### Listing all Tasks
Displays all tasks that the user has added to their list. <br />
Format: `list` <br />
Output could look like the following: <br />
```
1: [T][ ] go shopping
2: [D][ ] finish 2113 iP (by: Friday)
3: [E][ ] 2113 project meeting (at: Monday 1:00PM)
```
`T` denotes a task of type Todo, `D` denotes a task of type Deadline, and `E` denotes a task of type Event.

### Marking a Task as complete
You have the option of marking (i.e. checking off) a task that has been completed. <br />
Format: `mark TASK_NUMBER` <br />
`TASK_NUMBER` is the numerical label assigned to the task (that you can find from the output of the `list` command). <br />
Example: <br />
Assuming the following task list: <br />
```
1: [T][ ] go shopping
2: [D][ ] finish 2113 iP (by: Friday)
3: [E][ ] 2113 project meeting (at: Monday 1:00PM)
```
`mark 2` would result in the following list: <br />
```
1: [T][ ] go shopping
2: [D][X] finish 2113 iP (by: Friday)
3: [E][ ] 2113 project meeting (at: Monday 1:00PM)
```

### Unmarking a Task
Alternatively, you may also unmark a task that has previously been marked. <br />
Format: `unmark TASK_NUMBER` <br />
Example: <br />
Assuming the following task list: <br />
```
1: [T][ ] go shopping
2: [D][ ] finish 2113 iP (by: Friday)
3: [E][X] 2113 project meeting (at: Monday 1:00PM)
```
`unmark 3` would result in the following list: <br />
```
1: [T][ ] go shopping
2: [D][ ] finish 2113 iP (by: Friday)
3: [E][ ] 2113 project meeting (at: Monday 1:00PM)
```

### Deleting a Task
Users may also delete a task from the list of tasks. <br />
Format `delete TASK_NUMBER` <br />
Example: <br />
Assuming the following task list: <br />
```
1: [T][ ] go shopping
2: [D][ ] finish 2113 iP (by: Friday)
3: [E][ ] 2113 project meeting (at: Monday 1:00PM)
```
`delete 2` would result in the following list: <br />
```
1: [T][ ] go shopping
2: [E][ ] 2113 project meeting (at: Monday 1:00PM)
```


### Finding a Task
Users can search for Tasks in their task list with a specific keywords. <br />
Format `find KEYWORD` <br />
Example: <br />
Assuming the following task list: <br />
```
1: [T][ ] go shopping
2: [D][ ] finish 2113 iP (by: Friday)
3: [E][X] 2113 project meeting (at: Monday 1:00PM)
```
`find 2113` would result in the following list: <br />
```
1: [T][ ] go shopping
2: [D][ ] finish 2113 iP (by: Friday)
3: [E][ ] 2113 project meeting (at: Monday 1:00PM)
```
3 changes: 3 additions & 0 deletions data/duke.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
T | 1 | go shopping
D | 1 | finish 2113 iP | Friday
E | 0 | 2113 project meeting | Monday 1:00PM
138 changes: 122 additions & 16 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,135 @@
# User Guide
Duke is a **desktop app for tracking tasks,
optimized for use via a Command Line Interface** (CLI).
As Duke is designed to be use in a CLI, this
application would benefit users who are able to type fast.

## Features
## Quick Start
1. Ensure you have Java 11 or above installed on your Computer
2. Download the latest JAR file from GitHub.
3. Copy the file to the folder you want to use as the home folder for your Duke application.
Note that the data file would also be created in the same folder.
4. Open the CLI at where you have placed the jar file and run it using the command
`java -jar ip.jar`
5. Type the commands in the box and press enter to execute it.
Here are some commands you can try:
- `list` : List all current tasks.
- `todo Read Book` : Adds a todo task of reading book.
- `delete 1` : Deletes the first task from list.
### Feature list:
* Listing all tasks: `list`
* Adding a new Todo task: `todo`
* Adding a new Deadline task: `deadline`
* Adding a new Event task: `event`
* Marking a task as done: `mark`
* Marking a task as not done: `unmark`
* Deleting a task: `delete`
* Finding a task: `find`
* Exiting the program: `bye`

### Feature-ABC
## Feature
### Adding a Task
There are three kinds of Tasks: Todos, Deadlines, and Events.
### Adding a Todo
Adds a Todo to the list of tasks. <br />
Format: `todo DESCRIPTION` <br />
Words in `UPPER_CASE` are the parameters. <br />
Examples:
* todo go to class
* todo buy fruits

Description of the feature.
### Adding a Deadline
Adds a Deadline to the list of tasks. <br />
Format: `deadline DESCRIPTION /by DEADLINE` <br />
Words in `UPPER_CASE` are the parameters. <br />
Examples: <br />
* deadline finish problem set /by Saturday
* deadine return book /by Sunday

### Feature-XYZ
### Adding an Event
Adds an Event to the list of tasks. <br />
Format: `event DESCRIPTION /at TIME` <br />
Words in `UPPER_CASE` are the parameters. <br />
Examples: <br />
* event project meeting /at Saturday 8:00PM
* event attend CS2113 lecture /at Friday 4:00PM

Description of the feature.

## Usage

### `Keyword` - Describe action

Describe the action and its outcome.
### Listing all Tasks
Displays all tasks that the user has added to their list. <br />
Format: `list` <br />
Output could look like the following: <br />
```
1: [T][ ] go shopping
2: [D][ ] finish 2113 iP (by: Friday)
3: [E][ ] 2113 project meeting (at: Monday 1:00PM)
```
`T` denotes a task of type Todo, `D` denotes a task of type Deadline, and `E` denotes a task of type Event.

Example of usage:
### Marking a Task as complete
You have the option of marking (i.e. checking off) a task that has been completed. <br />
Format: `mark TASK_NUMBER` <br />
`TASK_NUMBER` is the numerical label assigned to the task (that you can find from the output of the `list` command). <br />
Example: <br />
Assuming the following task list: <br />
```
1: [T][ ] go shopping
2: [D][ ] finish 2113 iP (by: Friday)
3: [E][ ] 2113 project meeting (at: Monday 1:00PM)
```
`mark 2` would result in the following list: <br />
```
1: [T][ ] go shopping
2: [D][X] finish 2113 iP (by: Friday)
3: [E][ ] 2113 project meeting (at: Monday 1:00PM)
```

`keyword (optional arguments)`
### Unmarking a Task
Alternatively, you may also unmark a task that has previously been marked. <br />
Format: `unmark TASK_NUMBER` <br />
Example: <br />
Assuming the following task list: <br />
```
1: [T][ ] go shopping
2: [D][ ] finish 2113 iP (by: Friday)
3: [E][X] 2113 project meeting (at: Monday 1:00PM)
```
`unmark 3` would result in the following list: <br />
```
1: [T][ ] go shopping
2: [D][ ] finish 2113 iP (by: Friday)
3: [E][ ] 2113 project meeting (at: Monday 1:00PM)
```

Expected outcome:
### Deleting a Task
Users may also delete a task from the list of tasks. <br />
Format `delete TASK_NUMBER` <br />
Example: <br />
Assuming the following task list: <br />
```
1: [T][ ] go shopping
2: [D][ ] finish 2113 iP (by: Friday)
3: [E][ ] 2113 project meeting (at: Monday 1:00PM)
```
`delete 2` would result in the following list: <br />
```
1: [T][ ] go shopping
2: [E][ ] 2113 project meeting (at: Monday 1:00PM)
```

Description of the outcome.

### Finding a Task
Users can search for Tasks in their task list with a specific keywords. <br />
Format `find KEYWORD` <br />
Example: <br />
Assuming the following task list: <br />
```
1: [T][ ] go shopping
2: [D][ ] finish 2113 iP (by: Friday)
3: [E][X] 2113 project meeting (at: Monday 1:00PM)
```
expected output
`find 2113` would result in the following list: <br />
```
1: [T][ ] go shopping
2: [D][ ] finish 2113 iP (by: Friday)
3: [E][ ] 2113 project meeting (at: Monday 1:00PM)
```
1 change: 1 addition & 0 deletions docs/_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
theme: jekyll-theme-dinky
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: duke.Duke

35 changes: 35 additions & 0 deletions src/main/java/duke/Duke.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package duke;
import duke.tasks.TaskList;
import java.io.IOException;

/**
* Entry point of the Duke application.
* Initializes the application and starts the interaction with the user.
*/
public class Duke {

private Storage storage;
private static TaskList taskList;
private Ui ui;

public Duke(String filePath) throws IOException {
storage = new Storage(filePath);
ui = new Ui();
taskList = new TaskList(storage);
taskList.loadTaskList();
}

public void run() throws IOException {
Ui.greeting();
startBot();
Ui.farewell();
}

private static void startBot() throws IOException {
taskList.processTasks();
}

public static void main(String[] args) throws IOException {
new Duke("data/duke.txt").run();
}
}
Loading