Duke project
This is a project named after the Java mascot Duke. Given below are instructions on how to use the interactive Duke bot.
User Guide
Setting up in Intellij
Prerequisites: JDK 11, update Intellij to the most recent version.
- Open Intellij (if you are not in the welcome screen, click
File>Close Projectto close the existing project first) - Open the project into Intellij as follows:
- Click
Open. - Select the project directory, and click
OK. - If there are any further prompts, accept the defaults.
- Click
- Configure the project to use JDK 11 (not other versions) as explained in here.
- After that, locate the
src/main/java/Launcher.javafile, right-click it, and chooseRun Launcher.main(). - Refer to the Features below for details of each command.
Features
NOTE: Words in UPPER_CASE are the parameters to be supplied by the user.
Adding a task:
Adding a ToDo task: todo
Adds a new ToDo task to the Duke’s tasklist.
Format: todo CONTENT
- The content field must be provided.
Examples:
todo hellotodo read book
Adding a Deadline task: deadline
Adds a new Deadline task to the Duke’s tasklist.
Format: deadline CONTENT /by DATE_AND_TIME
- The date and time must be in the format DD/MM/YYYY HH:MM
- Both fields must be provided.
Examples:
deadline read book /by 12/12/2020 18:30deadline return book /by 10/10/2020 10:00
Adding an Event task: event
Adds a new Event task to the Duke’s tasklist.
Format: event CONTENT /at DATE_AND_TIME
- The date and time must be in the format DD/MM/YYYY HH:MM
- Both fields must be provided.
Examples:
event go for meeting /at 12/10/2020 18:00event meet groupmates /at 10/10/2020 10:30
Listing all tasks: list
Shows a list of all tasks in the Duke’s tasklist.
Format: list
Marking a task as done: done
Marks an existing task in the Duke’s tasklist as done.
Format: done INDEX
- Updates the task status to done for the task at the specified
INDEX - The index refers to the index number shown in the displayed tasklist.
- The index must be a positive integer.
Examples:
listfollowed bydone 3marks the 3rd task in the tasklist as done.
Deleting a task: delete
Deletes an existing task from the Duke’s tasklist.
Format: delete INDEX
- Deletes the task at the specified
INDEX - The index refers to the index number shown in the displayed tasklist.
- The index must be a positive integer.
Examples:
listfollowed bydelete 1deletes the 1st task in the tasklist.
Finding a task by content: find
Finds tasks with contents that contain the given keyword/s.
Format: find KEYWORD OR KEYWORDS
- The search is case-sensitive.
- Only the contents of the tasks are searched.
- The following tasks will be returned:
- content matching the keyword/s
- the keyword/s form a part of the content
Examples:
find readreturns both task with contentread bookand task with contentreadfrom the tasklist.
Editing a task: edit
Editing a task’s content: edit_content
Edits an existing task’s content in the Duke’s tasklist.
Format: edit INDEX content NEW_CONTENT
- Edits the content of the task at the specified
INDEX - The index refers to the index number shown in the displayed tasklist.
- The index must be a positive integer.
- Existing content will be updated to
NEW_CONTENT. - All fields must be provided.
Examples:
edit 1 content read new bookedits the content of the 1st task in the tasklist toread new book.
Editing a task’s date and time: edit_datetime
Edits an existing task’s date and time in the Duke’s tasklist.
Format: edit INDEX datetime NEW_DATETIME
- Edit the date and time of the task at the specified
INDEX - The index refers to the index number shown in the displayed tasklist.
- The index must be a positive integer.
- The date and time must be in the format DD/MM/YYYY HH:MM
- Existing date and time will be updated to
NEW_DATETIME. - All fields must be provided.
Examples:
edit 2 datetime 12/12/2020 18:30edits the date and time of the 2nd task in the tasklist to12/12/2020 18:30.
Exiting the program: bye
Saves the tasklist’s changes to the file at relative filepath /data/duke.txt.
Format: bye
##Command Summary
| Action | Format, Examples |
|---|---|
| Add | ToDo Task todo CONTENT </br> e.g. todo hello </br> </br> Deadline Task </br> deadline CONTENT /by DATE_AND_TIME </br> e.g. deadline read book /by 12/12/2020 18:30 </br></br> Event Task </br> event CONTENT /at DATE_AND_TIME </br> e.g. event go for meeting /at 12/10/2020 18:00 |
| List | list |
| Done | done INDEX e.g. done 3 |
| Delete | delete INDEX e.g. delete 1 |
| Find | find KEYWORD OR KEYWORDS e.g. find read |
| Edit | Edit content edit INDEX content NEW_CONTENT e.g. edit 1 content read new book Edit date and time edit INDEX datetime NEW_DATETIME e.g. edit 2 datetime 12/12/2020 18:30 |
| Exit | bye |