diff --git a/UserData.txt b/UserData.txt new file mode 100644 index 000000000..e69de29bb diff --git a/docs/README.md b/docs/README.md index 8077118eb..b50bfac61 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,29 +1,208 @@ # User Guide +Duke is a CLI optimised bot that helps you create and manage 3 types of tasks - Deadlines, Events +and todo tasks. Users have the ability to create these tasks, mark them as done, delete +and find them. Users can also view their tasks in a list format. +* [Quick Start](#quick-start) +* [Features](#features) +* [Usage](#usage) + * [Adding a task](#adding-a-task) + * [Marking a task](#marking-a-task) + * [Deleting a task](#deleting-a-task) + * [Finding a task](#finding-a-task) + * [Listing all tasks](#listing-all-tasks) + * [Exiting the program](#exiting-the-program) +* [Command Summary](#command-summary) + +## Quick Start +1. Ensure you have Java 11 or above installed in your computer. +2. Download the latest iP.jar under v2.0 from [here](https://github.com/pragyan01/ip/releases). +3. Go to the folder you saved iP.jar and note the absolute file path. +4. If you are using Windows, open up a Command prompt terminal cmd.exe or powershell.exe and for + Mac and Linux users, do the same with the terminal of your respective systems. +5. Navigate to the folder where iP.jar is stored. +6. Execute java -jar iP.jar in the terminal, and the application will start running. +You should be able to see something like this: +``` +------------------------------------------------------------------------------------------ +Hello! I'm Duke. + ____ _ +| _ \ _ _| | _____ +| | | | | | | |/ / _ \ +| |_| | |_| | < __/ +|____/ \__,_|_|\_\___| +What can i do for you? +------------------------------------------------------------------------------------------ + +Enter your wish: +------------------------------------------------------------------------------------------ +``` ## Features +1. Add any of the 3 task types: todo, deadline and events +2. Mark a task as done +3. Delete a task +4. Find a specific task or tasks containing the searched keyword +5. List out all tasks +6. Exit the program -### Feature-ABC +## Usage -Description of the feature. +### Adding a task +Add tasks from any 3 types available: Todo, deadline and event -### Feature-XYZ +1. A todo task only has a description associated with it. + This command allows you to add a new todo task to your list. -Description of the feature. +`todo {task description}` - Adds a new todo task -## Usage +Example of usage: + +`todo buy dinner` + +Expected outcome: + +``` +That's the spirit! I've added this task: + +[T][ ] buy dinner + +Now you have 1 tasks in the list. +``` + +2. A deadline task has a description, and a deadline associated with it. + This command allows you to add a new deadline task to your list. + +`deadline {task description} /by {yyyy-mm-dd}` - Adds a new deadline task + +Example of usage: + +`deadline submit assignment /by 2021-10-30` + +Expected outcome: -### `Keyword` - Describe action +``` +Deadline Entered: Oct 30 2021 + +Got it. I've added this task: + +[D][ ] submit assignment (by: 2021-10-30) + +Now you have 2 tasks in the list. +``` -Describe the action and its outcome. +3. An event task has a description, and a duration associated with it. + This command allows you to add a new event task to your list. -Example of usage: +`event {task description} /at {duration}` - Adds a new event task -`keyword (optional arguments)` +Example of usage: + +`event team meeting /at Monday 5-6pm` Expected outcome: -Description of the outcome. +``` +Got it. I've added this task: + +[E][ ] team meeting (at: Monday 5-6pm) +Now you have 3 tasks in the list. ``` -expected output +### Marking a task +Marks a task's status as done. + +`done {task number}` - Updates the task as completed + +Example of usage: + +`done 1` + +Expected outcome: + ``` +Kudos! One less thing to stress about! + + [T][X] buy dinner +``` +### Deleting a task +Deletes a specific task from the list. + +`delete {task number}` - Removes the specific task + +Example of usage: + +`delete 1` + +Expected outcome: + +``` +One more thing outta your life as always... + + [T][X] buy dinner + +You now have 2 tasks left. +``` +### Finding a task +Searches for a specific task from the list or tasks containing the keyword. + +`find {keyword}` - Searches for tasks containing keyword + +Example of usage: + +`find assingment` + +Expected outcome: + +``` +Lucky for you, i'm really good at digging through your mess: +------------------------------------------------------------------------------------------ + +1. [D][ ] submit assignment (by: 2021-10-30) + +Enter your wish: +``` +### Listing all tasks +Prints all existing tasks in the list. + +`list` - Lists everything + +Example of usage: + +`list` + +Expected outcome: + +``` +1. [D][ ] submit assignment (by: 2021-10-30) + +2. [E][ ] team meeting (at: Monday 5-6pm) +``` +### Exiting the program +Terminates the program and exits. + +`bye` - Terminates program + +Example of usage: + +`bye` + +Expected outcome: + +``` +------------------------------------------------------------------------------------------ + +Ciao! More tasks to do later! +------------------------------------------------------------------------------------------ +``` +## Command Summary + +Description | Syntax | Example +------------|--------|-------- +Add todo task | todo {task description} | todo buy dinner +Add deadline task | deadline {task description} /by {yyyy-mm-dd} | deadline submit assignment /by 2021-10-30 +Add event task | event {task description} /at {duration} | event team meeting /at Monday 5-6pm +Mark task as done | done {task number} | done 1 +Delete a task | delete {task number} | delete 1 +Find a task | find {keyword} | find assignment +Exit the program | bye | bye + diff --git a/docs/_config.yml b/docs/_config.yml new file mode 100644 index 000000000..fc24e7a62 --- /dev/null +++ b/docs/_config.yml @@ -0,0 +1 @@ +theme: jekyll-theme-hacker \ No newline at end of file diff --git a/src/main/java/Duke.java b/src/main/java/Duke.java deleted file mode 100644 index 5d313334c..000000000 --- a/src/main/java/Duke.java +++ /dev/null @@ -1,10 +0,0 @@ -public class Duke { - public static void main(String[] args) { - String logo = " ____ _ \n" - + "| _ \\ _ _| | _____ \n" - + "| | | | | | | |/ / _ \\\n" - + "| |_| | |_| | < __/\n" - + "|____/ \\__,_|_|\\_\\___|\n"; - System.out.println("Hello from\n" + logo); - } -} diff --git a/src/main/java/META-INF/MANIFEST.MF b/src/main/java/META-INF/MANIFEST.MF new file mode 100644 index 000000000..2c9a9745c --- /dev/null +++ b/src/main/java/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Main-Class: duke.Duke + diff --git a/src/main/java/duke/Deadline.java b/src/main/java/duke/Deadline.java new file mode 100644 index 000000000..d4126c07a --- /dev/null +++ b/src/main/java/duke/Deadline.java @@ -0,0 +1,49 @@ +package duke; +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; + +/** + * Class that is used in order to create a new deadline task. + * + * @author pragyan01 + */ +public class Deadline extends Task { + + protected String by; + + /** + * Constructor to instantiate new deadline object + * + * @param description Description of the deadline task + * @param by Due date of the deadline task + */ + public Deadline(String description, String by) { + super(description); + LocalDate time = LocalDate.parse(by); + this.by = time.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); + } + + /** + * Method to return String that has been stored in the Arraylist. + * + * @return String stored in the ArrayList + */ + @Override + public String toString() { + return "[D][" + super.getStatusIcon() + "] " + super.toString() + "(by: " + by + ")"; + } + + /** + * Method to return String that has been stored in the Arraylist. + * + * @return String stored in the ArrayList + */ + @Override + public String toSave() { + int done = 0; + if (this.isDone) { + done = 1; + } + return "deadline " + description + "/by " + by + " | " + done; + } +} diff --git a/src/main/java/duke/Duke.java b/src/main/java/duke/Duke.java new file mode 100644 index 000000000..26a32fda8 --- /dev/null +++ b/src/main/java/duke/Duke.java @@ -0,0 +1,20 @@ +package duke; +import static duke.Parser.inputSort; +import static duke.Ui.start; + +/** + * Main class of Duke bot. + * + * @author pragyan01 + */ +public class Duke { + + /** + * Main method of Duke bot. + */ + public static void main(String[] args) throws DukeException { + start(); + inputSort(); + } +} + diff --git a/src/main/java/duke/DukeException.java b/src/main/java/duke/DukeException.java new file mode 100644 index 000000000..3c1763dfd --- /dev/null +++ b/src/main/java/duke/DukeException.java @@ -0,0 +1,7 @@ +package duke; + +public class DukeException extends Exception { + public DukeException(String errorMessage) { + super(errorMessage); + } +} diff --git a/src/main/java/duke/Event.java b/src/main/java/duke/Event.java new file mode 100644 index 000000000..21e78756c --- /dev/null +++ b/src/main/java/duke/Event.java @@ -0,0 +1,46 @@ +package duke; + +/** + * Class that is used in order to create a new event task. + * + * @author pragyan01 + */ +public class Event extends Task { + + protected String at; + + /** + * Constructor to instantiate new event object + * + * @param description Description of the event task + * @param at Due date of the event task + */ + public Event(String description, String at) { + super(description); + this.at = at; + } + + /** + * Method to return String that has been stored in the Arraylist. + * + * @return String stored in the ArrayList + */ + @Override + public String toString() { + return "[E][" + super.getStatusIcon() + "] " + super.toString() + "(at: " + at + ")"; + } + + /** + * Method to return String that has been stored in the Arraylist. + * + * @return String stored in the ArrayList + */ + @Override + public String toSave() { + int done = 0; + if (this.isDone) { + done = 1; + } + return "event " + description + "/at " + at + " | " + done; + } +} diff --git a/src/main/java/duke/Parser.java b/src/main/java/duke/Parser.java new file mode 100644 index 000000000..f4d75ebc2 --- /dev/null +++ b/src/main/java/duke/Parser.java @@ -0,0 +1,69 @@ +package duke; +import java.time.format.DateTimeParseException; +import java.util.Scanner; +import static duke.Storage.saveData; +import static duke.TaskList.*; + +/** + * Class responsible for filtering out user commands and determining the flow of the program. + * + * @author pragyan01 + */ +public class Parser { + + /** + * Method that determines the control flow of the duke bot based on user input + * + * @throws DukeException custom error message when list is asked to be printed but empty + * @throws DateTimeParseException if format entered by user is not correct + */ + public static void inputSort() throws DukeException { + while (quitFlag == 0) { + System.out.println("Enter your wish: " + "\n" + line); + Scanner scan = new Scanner(System.in); + String input = scan.nextLine(); + String actionWord = input.split(" ")[0]; + switch (actionWord) { + case "bye": + sayBye(input); + break; + case "list": + try { + sayList(); + } catch (DukeException e) { + System.out.println(line + "\n" + "Hold your horses, you didn't even tell me about your wishes yet!" + "\n" + line + "\n"); + } + break; + case "done": + sayDone(input); + saveData(t); + break; + case "todo": + sayTodo(input); + saveData(t); + break; + case "deadline": + try { + sayDeadline(input); + saveData(t); + } catch (DateTimeParseException e) { + System.out.println("Please enter in the format: deadline (desc) /by yyyy-mm-dd"); + } + break; + case "event": + sayEvent(input); + saveData(t); + break; + case "delete": + sayDelete(input); + saveData(t); + break; + case "find": + sayFind(input); + break; + default: + System.out.println(line + "\n☹ OOPS!!! I'm sorry, but I don't know what that means :-(\n" + line); + } + } + } +} diff --git a/src/main/java/duke/Storage.java b/src/main/java/duke/Storage.java new file mode 100644 index 000000000..2475d1772 --- /dev/null +++ b/src/main/java/duke/Storage.java @@ -0,0 +1,87 @@ +package duke; +import java.io.*; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.nio.file.StandardOpenOption; +import java.util.ArrayList; +import java.util.Scanner; +import static duke.TaskList.*; + +/** + * Class responsible for saving and loading of tasks to/from a local file. + * + * @author pragyan01 + */ +public class Storage { + + /** + * Writes tasks in Arraylist and saves to local file in offline storage. + * + * @param t storing all tasks in the bot + */ + public static void saveData(ArrayList t) { + try { + String path = new File("userData.txt").getAbsolutePath(); + FileWriter fw = new FileWriter(path, false); + PrintWriter pw = new PrintWriter(fw, false); + pw.flush(); + pw.close(); + fw.close(); + for (int i = 0; i < taskCount; i++) { + String input = t.get(i).toSave() + "\n"; + Files.write(Paths.get(path), input.getBytes(), StandardOpenOption.APPEND); + } + } catch (IOException e) { + System.out.println("ERROR: Could not write to file"); + } + } + + /** + * Method that loads the offline txt file tasks into the bot. + * + * @throws FileNotFoundException if file does not exist in path specified + * @throws DukeException custom error message + */ + public static void loadData() throws FileNotFoundException, DukeException { + String path = new File("userData.txt").getAbsolutePath(); + File f = new File(path); + + Scanner scan = new Scanner(f); + String taskType; + String s; + int taskNumber = 1; + + while(scan.hasNext()) + { + String data = scan.nextLine(); + String[] arrayString = data.split(" \\| "); + String[] arrayString2 = arrayString[0].split(" "); + taskType = arrayString2[0]; + s = Integer.toString(taskNumber); + + switch (taskType) { + case "todo": + sayTodo(arrayString[0]); + if (arrayString[1].equals("1")) { + sayDone(s); + } + break; + case "deadline": + sayDeadline(arrayString[0]); + if (arrayString[1].equals("1")) { + sayDone(s); + } + break; + case "event": + sayEvent(arrayString[0]); + if (arrayString[1].equals("1")) { + sayDone(s); + } + break; + default: + } + taskNumber++; + } + scan.close(); + } +} diff --git a/src/main/java/duke/Task.java b/src/main/java/duke/Task.java new file mode 100644 index 000000000..3871b5c22 --- /dev/null +++ b/src/main/java/duke/Task.java @@ -0,0 +1,61 @@ +package duke; + +/** + * Task class used by bot. + * + * @author pragyan01 + */ +public class Task { + + protected String description; + protected boolean isDone; + + /** + * Constructor of task + * + * @param description Description of task. + */ + public Task(String description) { + this.description = description; + this.isDone = false; + } + + /** + * Return status of task as string. + * + * @return String status of task + */ + public String getStatusIcon() { + return (isDone ? "X" : " "); + } + + /** + * Setter method of task + */ + public void markAsDone() { + isDone = true; + } + + /** + * Getter method of task. + * + * @return String description of task + */ + public String toString() { + return description; + } + + /** + * Method to return String that has been stored in the Arraylist. + * + * @return String stored in the ArrayList + */ + public String toSave() { + int done = 0; + if (this.isDone) { + done = 1; + } + return "taskType" + description + " | " + done; + } +} + diff --git a/src/main/java/duke/TaskList.java b/src/main/java/duke/TaskList.java new file mode 100644 index 000000000..b8353e63b --- /dev/null +++ b/src/main/java/duke/TaskList.java @@ -0,0 +1,205 @@ +package duke; +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.util.ArrayList; + +/** + * Class that contains methods to handle respective user inputs. + * + * @author pragyan01 + */ +public class TaskList { + + public static String line = "------------------------------------------------------------------------------------------\n"; + public static ArrayList t = new ArrayList<>(); + public static int taskCount = 0; + public static int quitFlag = 0; + + /** + * Method that updates quitFlag to 1 when user wants to terminate the program. + */ + public static void updateQuitFlag() { + quitFlag = 1; + } + + /** + * Terminates the program. + * + * @param input that user gives + * @throws DukeException custom error message if bye command not entered in correct format by user + */ + public static void sayBye(String input) throws DukeException{ + if (input.length() != 3) { + throw new DukeException("You didn't say bye properly, but i get it! Adios for now!\n"); + } else { + System.out.println(line + "\n" + "Ciao! More tasks to do later!\n" + line); + updateQuitFlag(); + } + System.exit(0); + } + + /** + * Prints out all the tasks, their types and statuses stored by the bot. + * + * @throws DukeException custom error message when user asks to print list but is empty + */ + public static void sayList() throws DukeException{ + if (taskCount == 0) { + throw new DukeException(line + "\n" + "Hold your horses, you didn't even tell me about your wishes yet!" + "\n" + line + "\n"); + } else { + System.out.println(line); + for (int i = 0; i < taskCount; i++) { + System.out.println((i + 1) + ". " + t.get(i).toString() + "\n"); + } + System.out.println(line); + } + } + + /** + * Marks a specific task stored as done. + * + * @param input that user gives containing the position of task + * @throws DukeException custom error message when user enters task number in array out of bounds + * @throws DukeException custom error message when user tries to mark a task as done which doesn't exist + */ + public static void sayDone(String input) throws DukeException { + if (taskCount != 0) { + try { + String taskNumber = input.substring(input.lastIndexOf(" ") + 1); + int finalTaskNumber = Integer.parseInt(taskNumber) - 1; + t.get(finalTaskNumber).markAsDone(); + System.out.println(line + "\n" + "Kudos! One less thing to stress about!\n"); + System.out.println(" " + t.get(finalTaskNumber).toString() + "\n" + line); + } catch (NullPointerException e) { + System.out.println(line + "\nInvalid task number entered! Please try again!\n" + line); + } + } else { + throw new DukeException("Calm down, we haven't even started listing out tasks yet!"); + } + } + + /** + * Adds a todo task. + * + * @param input that user gives + */ + public static void sayTodo(String input) { + if (input.length() == 4) { + System.out.println(line + "\nDid you forget what you were gonna say?\n" + line); + } else { + int endIndex = input.length(); + String taskName = input.substring(5, endIndex); + t.add(taskCount, new Todo(taskName)); + System.out.println(line + "\n"); + System.out.println("That's the spirit! I've added this task:\n"); + System.out.println(t.get(taskCount).toString()); + taskCount++; + System.out.println("\nNow you have " + taskCount + " tasks in the list.\n" + line); + } + } + + /** + * Adds a deadline task. + * + * @param input that user gives + */ + public static void sayDeadline(String input) { + if (input.length() == 8) { + System.out.println(line + "\nAre you kidding me? You didn't even tell me what you were supposed to do!\n"); + System.out.println(line); + } else if (!input.contains("/")) { + System.out.println(line + "\nAre you kidding me? You forgot to tell me your deadline again?\n" + line); + } else { + int endIndex = input.indexOf("/"); + String taskName = input.substring(9, endIndex); + int endIndex2 = input.length(); + String by = input.substring(endIndex + 4, endIndex2); + LocalDate dateTime = LocalDate.parse(by); + t.add(taskCount, new Deadline(taskName, by)); + System.out.println(line + "\n"); + System.out.println("Deadline Entered: " + dateTime.format(DateTimeFormatter.ofPattern("MMM d yyyy")) + "\n"); + System.out.println("Got it. I've added this task:\n"); + System.out.println(t.get(taskCount).toString()); + taskCount++; + System.out.println("\nNow you have " + taskCount + " tasks in the list.\n" + line); + } + } + + + /** + * Adds a event task. + * + * @param input that user gives + */ + public static void sayEvent(String input) { + if (input.length() == 5) { + System.out.println(line + "\nAre you kidding me? You didn't even tell me what you were supposed to do!\n"); + System.out.println(line); + } else if (!input.contains("/")) { + System.out.println(line + "\nAre you kidding me? You forgot to tell me your event timing again?\n" + line); + } else { + int endIndex = input.lastIndexOf("/"); + String taskName = input.substring(6, endIndex); + int endIndex2 = input.length(); + String at = input.substring(endIndex + 4, endIndex2); + t.add(taskCount, new Event(taskName, at)); + System.out.println(line + "\n"); + System.out.println("Got it. I've added this task:\n"); + System.out.println(t.get(taskCount).toString()); + taskCount++; + System.out.println("\nNow you have " + taskCount + " tasks in the list.\n" + line); + } + } + + /** + * Deletes a specific task. + * + * @param input that user gives containing the position of task + * @throws DukeException custom error message when user deletes task number in array out of bounds + */ + public static void sayDelete(String input) throws DukeException { + if (taskCount != 0) { + try { + String taskNumber = input.substring(input.lastIndexOf(" ") + 1); + int finalTaskNumber = Integer.parseInt(taskNumber) - 1; + Task taskRemoved = t.get(finalTaskNumber); + t.remove(finalTaskNumber); + taskCount--; + System.out.println(line + "\n" + "One more thing outta your life as always...\n"); + System.out.println(" " + taskRemoved.toString() + "\n" + "\nYou now have " + taskCount + " tasks left.\n"); + System.out.println(line); + } catch (IndexOutOfBoundsException e) { + System.out.println(line + "\nInvalid task number entered! Please try again!\n" + line); + } + } else { + throw new DukeException("Calm down, we don't even have tasks yet!"); + } + } + + /** + * Finds and prints a specific task. + * + * @param input that user gives containing the position of task + */ + public static void sayFind(String input){ + String[] arrayString = input.split(" ", 2); + String keyWord = arrayString[1]; + int matchCount = 0; + + ArrayList filteredList = new ArrayList<>(); + for (Task task : t) { + if (task.toString().contains(keyWord)) { + filteredList.add(task.toString()); + matchCount++; + } + } + if (matchCount != 0) { + System.out.println("\n" + "Lucky for you, i'm really good at digging through your mess:" + "\n" + line); + for (int i = 0; i < filteredList.size(); i++) { + System.out.println((i + 1) + ". " + filteredList.get(i) + "\n"); + } + } else { + System.out.println("Too bad i couldn't find anything similar. Let's not get too ambitious and just stick to the tasks on hand shall we?" + "\n"); + } + } +} diff --git a/src/main/java/duke/Todo.java b/src/main/java/duke/Todo.java new file mode 100644 index 000000000..c0ecc1104 --- /dev/null +++ b/src/main/java/duke/Todo.java @@ -0,0 +1,43 @@ +package duke; + +/** + * Class that is used in order to create a new todo task. + * + * @author pragyan01 + */ +public class Todo extends Task{ + + /** + * Constructor to instantiate new todo object + * + * @param description Description of the todo task + */ + public Todo(String description) { + super(description); + } + + /** + * Method to return String that has been stored in the Arraylist. + * + * @return String stored in the ArrayList + */ + @Override + public String toString() { + return "[T][" + super.getStatusIcon() + "] " + super.toString(); + } + + /** + * Method to return String that has been stored in the Arraylist. + * + * @return String stored in the ArrayList + */ + @Override + public String toSave() { + int done = 0; + if (this.isDone) { + done = 1; + } + return "todo " + description + " | " + done; + } +} + diff --git a/src/main/java/duke/Ui.java b/src/main/java/duke/Ui.java new file mode 100644 index 000000000..0e48d17d7 --- /dev/null +++ b/src/main/java/duke/Ui.java @@ -0,0 +1,34 @@ +package duke; +import java.io.FileNotFoundException; +import static duke.Storage.loadData; + +/** + * Class responsible for displaying the welcome messages by the bot. + * + * @author pragyan01 + */ +public class Ui { + + public static String line = "------------------------------------------------------------------------------------------\n"; + public static String logo = " ____ _ \n" + + "| _ \\ _ _| | _____ \n" + + "| | | | | | | |/ / _ \\\n" + + "| |_| | |_| | < __/\n" + + "|____/ \\__,_|_|\\_\\___|\n"; + + /** + * Method that prints a greeting and loads previously saved tasks into the bot. + * + * @throws DukeException custom error message if file not found + */ + public static void start() throws DukeException { + try { + loadData(); + + System.out.println(line + "Hello! I'm Duke.\n" + logo + "What can i do for you?\n" + line); + } catch (FileNotFoundException e) { + System.out.println(line + "\n" + "Saved file could not be found. I've used one of your wishes to create a new file for you! Thank me later."); + System.out.println(line + "Hello! I'm Duke.\n" + logo + "What can i do for you?\n" + line); + } + } +} diff --git a/text-ui-test/EXPECTED.TXT b/text-ui-test/EXPECTED.TXT index 657e74f6e..f168b908e 100644 --- a/text-ui-test/EXPECTED.TXT +++ b/text-ui-test/EXPECTED.TXT @@ -1,7 +1,26 @@ -Hello from - ____ _ -| _ \ _ _| | _____ +------------------------------------------------------------------------------------------ +Hello! I'm Duke. + ____ _ +| _ \ _ _| | _____ | | | | | | | |/ / _ \ | |_| | |_| | < __/ |____/ \__,_|_|\_\___| +What can i do for you? +------------------------------------------------------------------------------------------ + +Enter your wish: +------------------------------------------------------------------------------------------ + +------------------------------------------------------------------------------------------ + + +Got it. I've added this task: + +[T][ ] borrow book + +Now you have 1 tasks in the list. +------------------------------------------------------------------------------------------ + +Enter your wish: +------------------------------------------------------------------------------------------ diff --git a/text-ui-test/input.txt b/text-ui-test/input.txt index e69de29bb..8b1378917 100644 --- a/text-ui-test/input.txt +++ b/text-ui-test/input.txt @@ -0,0 +1 @@ + diff --git a/text-ui-test/runtest.bat b/text-ui-test/runtest.bat index 087374464..289e6aa60 100644 --- a/text-ui-test/runtest.bat +++ b/text-ui-test/runtest.bat @@ -10,6 +10,7 @@ REM compile the code into the bin folder javac -cp ..\src\main\java -Xlint:none -d ..\bin ..\src\main\java\*.java IF ERRORLEVEL 1 ( echo ********** BUILD FAILURE ********** + pause exit /b 1 ) REM no error here, errorlevel == 0 @@ -19,3 +20,4 @@ java -classpath ..\bin Duke < input.txt > ACTUAL.TXT REM compare the output to the expected output FC ACTUAL.TXT EXPECTED.TXT +pause \ No newline at end of file