Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
23ee579
Add hello and bye message (level-0)
Aug 25, 2021
0cde5bb
Level-1 commit:
Aug 25, 2021
7783a22
Level-2
Aug 25, 2021
6f7343a
Added class ToDo, Added markAsDone to indicate in list and done command
Aug 25, 2021
9bd0f12
fixed indentation
Aug 25, 2021
74a56b1
fixed Coding Standards
Aug 25, 2021
f59d5c0
ToDos, Events, Deadline Class added
Aug 31, 2021
02a02a5
Semi Automated Test Added
Aug 31, 2021
0396222
Added AcknowledgeAddition function (refractored)
Sep 5, 2021
d6f724c
Fixed ui-test
Sep 5, 2021
4b85e02
clean up before ip. refractored project
Sep 7, 2021
7e9059f
added Illegal ToDo Exception
Sep 7, 2021
08e054f
Added InvalidCommandException
Sep 7, 2021
328e111
moved everything to duke package, and split command exceptions and ta…
Sep 7, 2021
9691fdf
Merge branch 'branch-Level-5'
Sep 7, 2021
cec0cc5
Merge branch 'branch-A-Packages'
Sep 7, 2021
23e7bae
removeed unneecessary code
Sep 7, 2021
779f267
imported ArrayList
Sep 14, 2021
02e647d
Added Delete function
Sep 14, 2021
3a4d6be
Added Save to duke.txt
Sep 14, 2021
10c23de
Added loadSaved
Sep 14, 2021
0ec8b30
Merge branch 'branch-Level-6'
Sep 14, 2021
3861391
Merge branch 'branch-Level-7'
Sep 15, 2021
c1dbe30
Added EmptyCommand Exception class
Sep 15, 2021
234b547
Use More OOP: Added Parser, Storage, TaskList, Ui classes.
Sep 26, 2021
7138905
Added DukeExceptions class. Improved exception handling to handle mor…
Sep 27, 2021
bc637b2
Added optional for user: DateTime Format
Sep 27, 2021
42d14fa
Added Find function
Sep 27, 2021
0aae49d
Added JavaDoc
Sep 27, 2021
2348803
Merge pull request #1 from uosjapuelks/branch-Level-8
uosjapuelks Sep 28, 2021
1feb01f
Merge branch 'master' into branch-Level-9
uosjapuelks Sep 28, 2021
d2eaf8d
Merge pull request #2 from uosjapuelks/branch-Level-9
uosjapuelks Sep 28, 2021
b2480c2
Merge branch 'master' into branch-A-JavaDoc
uosjapuelks Sep 28, 2021
8c4b2ce
Merge pull request #3 from uosjapuelks/branch-A-JavaDoc
uosjapuelks Sep 28, 2021
56d7592
Merge branch 'master' of https://github.com/uosjapuelks/ip
Sep 28, 2021
c9ae39b
Improved DateTime formatting. Can now save to file in correct format.
Sep 28, 2021
f036a86
Followed code style
Sep 28, 2021
7e62ded
Followed code Style
Sep 28, 2021
8abfb57
Fixed Missing Date / Time error
Sep 28, 2021
145eb53
Formatted JavaDoc
Sep 28, 2021
e2cf455
Fixed some bugs
Sep 28, 2021
14111c5
Made UI look nicer
Sep 28, 2021
2ac746b
Added user guide
Sep 28, 2021
cf461d1
Set theme jekyll-theme-hacker
uosjapuelks Sep 28, 2021
75cbc1e
Set theme jekyll-theme-modernist
uosjapuelks Sep 28, 2021
9458de1
Merge branch 'master' of https://github.com/uosjapuelks/ip
Sep 28, 2021
7ecef5e
Set theme jekyll-theme-leap-day
uosjapuelks Sep 28, 2021
709fcd6
Set theme jekyll-theme-leap-day
uosjapuelks Sep 28, 2021
f734c1b
Fixed UG typo
Sep 28, 2021
6ea4e4e
Merge branch 'master' of https://github.com/uosjapuelks/ip
Sep 28, 2021
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
234 changes: 221 additions & 13 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,237 @@
# User Guide
##Getting Started
### Preparations
Ensure that `ip.jar` is located within a folder of its own.
Open up a Terminal and ensure to the directory is the same as the folder `ip.jar` is located in.
### Initialising Duke
Enter the following into the terminal to initialise Duke application.
```
java -jar ip.jar
```
## Features and Usage
### Feature List
- `help`
- `todo`
- `deadline`
- `event`
- `list`
- `done`
- `delete`
- `bye`

*All commands are not case-sensitive:*

`dEAdLine`, `deadline`, and `Deadline` All mean: `deadline`.
___
---

### List Commands: `help`
Prints all commands available.

**Example of usage:**

*input:*
```
help
```
---
---

### Add ToDo: `todo`
Adds a new ToDo to the task list. A ToDo is a task with a description of the task.

**Arguments:**
1. `<desc>` - Description of the ToDo task.

**Format:** `todo <desc>`

**Example of usage:**

*input:*
```
todo Eat apples
```
*output:*
```
Got it. I've added this task:
1.[T][ ] Eat apples
Now you have 1 tasks in the list.
```
---
---
### Add Deadline: `deadline`
Adds a new Deadline to the task list. A Deadline is a task with a description of the task and a deadline.

**Arguments:**
1. `<desc>` - Description of the Deadline task.
2. `<by>` - DateTime the deadline should be done by.

**Format:**
- `deadline <desc> /by <by>`

`<by>` *is accepted in the following formats:*
- `Custom input`
- `dd/mm/yyyy`
- `dd/mm/yyyy hhmm`

**Example of usage:**

*input:*
```
deadline IEM2 Assignment /by This Friday
```
*output:*
```
Got it. I've added this task:
2.[D][ ] IEM2 Assignment (by: This Friday)
Now you have 2 tasks in the list.
```
___
*input:*
```
deadLine CS2113T ip submission /by 01/10/2021 2359
```
*output:*
```
Got it. I've added this task:
3.[D][ ] CS2113T ip Submission (by: Oct 1 2021 11:59 PM)
Now you have 3 tasks in the list.
```
___
---
### Add Event: `event`
Adds a new Event to the task list. An Event is a task with a description of the task and a event.

**Arguments:**
1. `<desc>` - Description of the Event task.
2. `<at>` - DateTime or Location the Event should be happening at.

## Features
**Format:**
- `event <desc> /at <at>`

### Feature-ABC
`<at>` is accepted in the following formats:
- `Custom input`
- `dd/mm/yyyy`
- `dd/mm/yyyy hhmm`

Description of the feature.
**Example of usage:**

### Feature-XYZ
*input:*
```
event Dance show /at Esplanade
```
*output:*
```
Got it. I've added this task:
4.[E][ ] Dance show (at: Esplanade)
Now you have 4 tasks in the list.
```
---
*input:*
```
Event No Time To Die premiere /at 30/09/2021
```
*output:*
```
Got it. I've added this task:
5.[E][ ] No Time To Die premiere (at: Sep 30 2021)
Now you have 5 tasks in the list.
```
___
---
### List Tasks: `list`
Prints all tasks in the task list.

**Arguments:**
None

**Format:**
- `list`

**Example of usage:**

*input*
```
list
```
*output:*
```
Here are the tasks in your list:
1.[T][ ] Eat apples
2.[D][ ] IEM2 Assignment (by: This Friday)
3.[D][ ] CS2113T ip Submission (by: Oct 1 2021 11:59 PM)
4.[E][ ] Dance show (at: Esplanade)
5.[E][ ] No Time To Die premiere (at: Sep 30 2021)

```
---
---
### Mark Task as Done: `done`
Marks a Task in the Task List as done.

**Arguments:**
1. `<index>` - Task index with respect to the list.

**Format:**
- `done <index>`

`<index>` *should only be a number from the list*

**Example of usage:**

*input:*
```
done 4
```
*output:*
```
Nice, I've marked this task as Done:
[E][X] Dance show (at: Esplanade)
```
___
---
### Remove Task from Task List: `delete`
Delete a Task from the Task List.

Description of the feature.
**Arguments:**
1. `<index>` - Task index with respect to the list.

## Usage
**Format:**
- `delete <index>`

### `Keyword` - Describe action
*`<index>` should only be a number from the list*

Describe the action and its outcome.
**Example of usage:**

Example of usage:
*input:*
```
delete 3
```
*output:*
```
Noted! I've removed this task:
3.[D][ ] CS2113T ip Submission (by: Oct 1 2021 11:59PM)
Now you have 4 tasks in the list.
```
___
---
### Remove Task from Task List: `bye`
Exits Duke application.

`keyword (optional arguments)`
**Arguments:**
None

Expected outcome:
**Format:**
- `bye`

Description of the outcome.
**Example of usage:**

*input:*
```
bye
```
*output:*
```
expected output
Bye. try not to procrastinate!
```
___
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-leap-day
10 changes: 0 additions & 10 deletions src/main/java/Duke.java

This file was deleted.

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

import duke.DukeExceptions.EmptyCommand;
import duke.DukeExceptions.InvalidCommandException;
import duke.task.Task;

import java.io.FileNotFoundException;
import java.util.Scanner;
import java.util.ArrayList;

public class Duke {

private final Storage storage;
private TaskList tasksLs;
private final Ui ui;

private final Scanner in = new Scanner(System.in);

/**
* A constructor to initiate Duke.
*
* @param filepath Filepath when initiating.
*/
public Duke(String filepath) {
this.tasksLs = new TaskList(new ArrayList<Task>());
this.storage = new Storage(filepath);
this.ui = new Ui();
}

/**
* Runs Duke object until user exits with </bye>.
*/
private void run() {
ui.greetMessage();
String input = "";
try {
tasksLs = storage.loadFile(tasksLs.getList());
} catch (FileNotFoundException e) {
storage.createFile();
}

boolean closeDuke = false;
do {
try {
input = getInput();
String parsed = new Parser(tasksLs, ui).parse(input);
System.out.println(parsed);
storage.autoSave(tasksLs.getList());
closeDuke = input.trim().equals("bye");
} catch (InvalidCommandException | EmptyCommand e) {
System.out.println(e);
}
} while (!closeDuke);
}

/**
* Prompts user for input.
*
* @return String input by user.
*/
private String getInput() {
return in.nextLine();
}

/**
* application.
*
* @param args to start Duke Application.
*/
public static void main(String[] args) {
new Duke("duke.txt").run();
}
}
12 changes: 12 additions & 0 deletions src/main/java/duke/DukeExceptions/DukeException.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package duke.DukeExceptions;

public class DukeException extends Exception {
/**
* convert to new default Exception message.
*
* @return error Message.
*/
public String toString() {
return "Something Went Wrong";
}
}
15 changes: 15 additions & 0 deletions src/main/java/duke/DukeExceptions/EmptyCommand.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package duke.DukeExceptions;

public class EmptyCommand extends DukeException {

/**
* @return Empty input Message.
*/
public String toString() {
return ("\t______________________________________________________________________\n" +
"\tNo command detected. Command was empty :)\n" +
"\t______________________________________________________________________\n" +
"\tKey in [help] to list available commands\n" +
"\t______________________________________________________________________\n");
}
}
Loading