The following Features will allow you to add Tasks to the current Task List.
todo
Adds basic ToDo Task which only contains a description
and a completion status
to the current Task List.
Syntax:
todo
DESCRIPTION
Example:
todo walk the dog
Outcome:
An incomplete
ToDo Task with the DESCRIPTION
walk the dog
is added to the current TaskList.
deadline
Adds a Deadline Task which contains a description
and a date-time to complete by
to the current Task List.
Syntax:
deadline
DESCRIPTION
/by
DATETIME_TO_COMPLETE
Example:
deadline Walk the dog /by 3pm
Outcome:
An incomplete
Deadline Task with the DESCRIPTION
Walk the dog
, and DATETIME_TO_COMEPLETE
of 3pm
is added to the current Task List`
Formatted date and time:
If
DATETIME_TO_COMPLETE
is entered in thedd/MM/yyyy hhmm
format, it will automatically be converted to a more readable format.Example:
deadline Walk the dog /by 11/11/1111 1111
Outcome:
Anincomplete
Deadline Task with theDESCRIPTION
Walk the dog
andDATETIME_TO_COMEPLETE
of11th of NOVEMBER 2019, 11.11am
is added to the current Task List.
event
Adds an Event Task which contains a description
and a date-time of event
to the current Task List.
Syntax:
event
DESCRIPTION
/by
DATETIME_OF_EVENT
Example:
deadline Walk the dog /at 3pm
Outcome:
An incomplete
Deadline Task with the DESCRIPTION
Walk the dog
and DATETIME_OF_EVENT
of 3pm
is added to the current Task List.
Formatted date and time:
If
DATETIME_TO_COMPLETE
is entered in thedd/MM/yyyy hhmm
format, it will automatically be converted to a more readable format.Example:
event Walk the dog /at 11/11/1111 1111
Outcome:
Anincomplete
Event Task with theDESCRIPTION
Walk the dog
andDATETIME_OF_EVENT
of11th of NOVEMBER 2019, 11.11am
is added to the current Task List.
list
Displays all the current tasks in your current Task List.
Command:
list
Outcome:
All the tasks in the current Task List will be displayed.
done
Marks a Task in the current Task List which corresponds to the given INDEX
.
Syntax:
done
INDEX
Example:
done
4
Outcome:
The 4th
task in the current Task List will have it’s completion status
to set complete
.
delete
Removes a Task in the current Task List which corresponds to the given INDEX
.
Syntax:
delete
INDEX
Example:
delete
4
Outcome:
The 4th
task in the current Task List will be removed from it.
If you want to search for a task in the Current Task List there are two option. The first find
is more strict, while the second relaxfind
is less strict.
find
Lists all tasks in the current Task List which contain the given KEYWORD
in their descriptions
.
Syntax:
find
KEYWORD
Example:
find
dog
Outcome:
All tasks in the current Task List which contain the word dog
in their descriptions
.
Not case sensitive:
Tasks withdog
andDOG
in their description will both be included in the result list.
relaxfind
Lists all tasks in the current Task List whose description
contains a word whose Levenshtein distance from the KEYWORD
is less than or equal to 3
.
Syntax:
relaxfind
KEYWORD
Example:
relaxfind
dog
Outcome:
All tasks in the current Task List which contain contain a word whose Levenshtein distance from dog
is less than or equal to 3
.
Levenshtein distance:
In information theory, linguistics and computer science, the Levenshtein distance is a string metric for measuring the difference between two sequences. Informally, the Levenshtein distance between two words is the minimum number of single-character edits (insertions, deletions or substitutions) required to change one word into the other. - Wikipedia
Changes to your current Task List are automatically saved to the current Task List save file. Whenever you start Duke, the Task List will be loaded from the DukeSave01.txt
file.
load
Sets the current Task List to the Task List loaded from a Save File with the specified FILE_NAME
in the DukeSaveFiles
directory.
The save file which the current task list will save to it is shown in the top left of the window.
Syntax:
load
FILE_NAME
Example:
load DukeSave01
Outcome:
The current Task List will be set to the Task List as saved in the DukeSave01.txt
file under the DukeSaveFiles
directory.
Warning:
The file must be properly formatted for the Task List to be loaded.
Valid naming format:
File names can only contain alphanumeric characters. e.g.SavEfIle01
is valid but$@\/f|le01
is not.
Loading is optional:
Duke will load the default TaskList saved atDukeSave01.txt
Note:
If the file does not already exist in the directory, it will be created for you.
save
Saves the current TaskList to a Save File with the specified FILE_NAME
in the DukeSaveFiles
directory.
Syntax:
save
FILE_NAME
Example:
save
MySaveFile01
Outcome:
The tasks in the current Task List will be saved to the MySaveFile01.txt
in the DukeSaveFiles
directory.
Warning:
This will overwrite whatever data is in the existing file.
Note:
If the file does not already exist in the directory, it will be created for you.
If you are running from Duke from the .jar
, the DukeSaveFiles
directory will be created within the same directory where your duke-x.x.x.jar
file is located, if it does not already exist.
downloads
L duke-0.1.1.jar <------- .jar file
L DukeSaveFiles <----- DukeSaveFiles directory
L SaveFile02.txt <-- save file
If you are running Duke directly from the duke.gui.DukeLauncher
.class
file, the DukeSaveFiles
directory will be created within the same directory as the main
file.
downloads
L duke
L build
L classes
L java
L DukeSaveFiles < ------------- DukeSaveFiles directory
L SaveFile02.txt <--------- save file
L main <-------------------- main file
L duke
L gui
L DukeLauncher.class <-- .class file
If you want to edit the save files directly ensure they are formatted in the following way:
The first line of the file should contain the number of tasks that are in the task list
The subsequent lines will contain the data to create each task to populate the Task List. Tasks which require a date/time in the 4th line, otherwise only 3 lines are used.
number of tasks
type of task T = ToDo, D = Dealine, E = Event
completion status of task 0 = incomplete, 1 = complete
description of task
date/time of the task
...
...
...
Example
2
T
0
Walk the Dog
D
1
Walk the Cat
Yesterday
This creates a Task List with 2 Tasks:
incomplete
ToDo
task with the description Walk the Dog
.complete
Deadline
Task with the description Walk the Cat
and a time of Yesterday
.bye
Closing Duke.
Command:
bye
Outcome:
Duke will show a goodbye popup which you can click, or press Enter
to close Duke.
Alternatively
You may simply press the close button for the window.