This is Duke, a Java project that allows you to store different types of tasks in a local file. It's named after the Java mascot Duke. Given below are instructions on how to use it.
Prerequisites: JDK 11, update Intellij to the most recent version.
- Open Intellij (if you are not in the welcome screen, click
File
>Close Project
to close the existing project dialog first) - Set up the correct JDK version, as follows:
- Click
Configure
>Structure for New Projects
and thenProject Settings
>Project
>Project SDK
- If JDK 11 is listed in the drop down, select it. If it is not, click
New...
and select the directory where you installed JDK 11 - Click
OK
- Click
- Import the project into Intellij as follows:
- Click
Open or Import
. - Select the project directory, and click
OK
- If there are any further prompts, accept the defaults.
- Click
- After the importing is complete, locate the
src/main/java/Duke.java
file, right-click it, and chooseRun Duke.main()
. If the setup is correct, you should see something like the below:--------------------- Hello! I'm Duke What can I do for you? Tell me your plan! --------------------- file existed path: ...\data\tasks.txt
This section introduces basic commands in Duke.
Here are a list of basic commands:
list
todo [task_name]
deadline [task_name] /by [date]
event [task_name] /at [date]
done [task_index]
undone [task_index]
delete [task_index]
find [task_name]
clear
bye
Type list
in the CLI to call this command.
Format: list
This command lists all tasks stored in the file.
Example:
list
Type todo
followed by a task name in the CLI to call this command.
Format: todo [task_name]
This command adds a task to be done where task_name is its name, and it is by default set as not done.
Example:
todo homework
todo declare temperature
Type deadline
followed by a task name and /by
followed by a date in the CLI to call this command.
Format: deadline [task_name] /by [date]
This command adds a dadline where task_name is its name and date is the deadline date, and it is by default set as not done.
This date can be a short phrase or in YYYY-MM-DD format, which will be shown in the list as MMM dd yyyy. For instance, 2010-11-30 will be shown as Nov 30 2010.
Example:
deadline homework /by 2020-11-20
deadline declare temperature /by this afternoon
Type event
followed by a task name and /at
followed by a date in the CLI to call this command.
Format: event [task_name] /at [date]
This command adds an event where task_name is its name and date is the event date, and it is by default set as not done.
This date can be a short phrase or in YYYY-MM-DD format, which will be shown in the list as MMM dd yyyy. For instance, 2010-11-30 will be shown as Nov 30 2010.
Example:
event soccer game /at 2021-01-20
event dinner with friends /at next Tuesday
Type done
followed by a valid task index in the CLI to call this command.
Format: done [task_index]
This command marks a task as done where task_index is its index.
Example:
done 2
This will mark the second task in the list as done.
Type undone
followed by a valid task index in the CLI to call this command.
Format: undone [task_index]
This command marks a task as not done where task_index is its index.
Example:
undone 2
This will mark the second task in the list as undone.
Type delete
followed by a valid task index in the CLI to call this command.
Format: delete [task_index]
This command delete a task where task_index is its index.
Example:
delete 2
This will delete the second task in the list.
Type find
followed by a task name in the CLI to call this command.
Format: find [task_name]
This command finds all tasks that contain task_name in their task names.
Example:
find book
This will return a list of tasks that containbook
in their names.
Type clear
in the CLI to call this command.
Format: clear
This command clears all tasks stored in the file.
Example:
clear
Type bye
in the CLI to call this command.
Format: bye
This command exits Duke.
Example:
bye