Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
f306814
level0:
Jan 24, 2025
cf970a8
Rename, add greet, exit
zavsky Jan 24, 2025
2bbab8c
Add greeting, exit
zavsky Feb 7, 2025
6c70db6
Add echo user input
zavsky Feb 7, 2025
c4c4faf
Add tasks, list tasks
zavsky Feb 7, 2025
77839ab
mark and unmark tasks
zavsky Feb 9, 2025
6c39cff
Add todo, events, deadlines
zavsky Feb 9, 2025
eda5180
code standards compliance
zavsky Feb 9, 2025
b7a4a53
refactor and error handling
zavsky Feb 12, 2025
5ad547a
Merge branch 'branch-Level-5' into HEAD
zavsky Feb 12, 2025
e35e895
add basic undo last functionality
zavsky Feb 19, 2025
cc18725
add save and load functionality
zavsky Feb 20, 2025
4eef65c
Merge branch 'branch-Level-6'
zavsky Feb 20, 2025
351be6f
merge branch-Level-7 to branch-Level-6
zavsky Feb 20, 2025
9d41e65
refactor and better undo implementation
zavsky Feb 21, 2025
0f90bf2
improved delete logic
zavsky Feb 21, 2025
409731a
reduced magic strings
zavsky Feb 22, 2025
6402578
add ability to batch (un)mark/delete, transitive to undo
zavsky Feb 22, 2025
4442464
fixed variable spaces bug
zavsky Feb 22, 2025
9913a79
avoid duplicate indices, rewrite in lambda exp, prepare lvl8
zavsky Feb 24, 2025
27dc91e
update TaskManager to lambda expressions for scalability
zavsky Feb 26, 2025
5be9c7e
update MessageType to use lambda expressions
zavsky Feb 26, 2025
e16fc55
Removed duplicates, cleaned UI presentation
zavsky Feb 27, 2025
5fbe970
Add basic search-by-keyword functionality
zavsky Feb 27, 2025
7a3dbfa
Add JavaDoc
zavsky Feb 28, 2025
61a0382
Merge branch 'branch-A-JavaDoc'
zavsky Feb 28, 2025
dc65ce7
Merge branch-Level-9 with Master
zavsky Feb 28, 2025
1a92be7
Changed length of line separator
zavsky Feb 28, 2025
22f2a2f
Merge pull request #1 from zavsky/testing
zavsky Feb 28, 2025
ad398f7
Add product logo
zavsky Mar 14, 2025
9f85920
Update README.md
zavsky Mar 18, 2025
99947ed
Update README.md
zavsky Mar 18, 2025
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ bin/

/text-ui-test/ACTUAL.TXT
text-ui-test/EXPECTED-UNIX.TXT

*.class
*.jar
task.txt
48 changes: 27 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,32 @@
# Duke project template
# Bluebird project

This is a project template for a greenfield Java project. It's named after the Java mascot _Duke_. Given below are instructions on how to use it.
A very simple CLI-based real-life task manager written in Java. Given below are instructions on how to use it.

## Setting up in Intellij
If you're interested to find out what it does, check out the USERGuide[docs/README.md]!

Prerequisites: JDK 17, update Intellij to the most recent version.
## Running from Command Line (macOS)

1. Open Intellij (if you are not in the welcome screen, click `File` > `Close Project` to close the existing project first)
1. Open the project into Intellij as follows:
1. Click `Open`.
1. Select the project directory, and click `OK`.
1. If there are any further prompts, accept the defaults.
1. Configure the project to use **JDK 17** (not other versions) as explained in [here](https://www.jetbrains.com/help/idea/sdk.html#set-up-jdk).<br>
In the same dialog, set the **Project language level** field to the `SDK default` option.
1. After that, locate the `src/main/java/Duke.java` file, right-click it, and choose `Run Duke.main()` (if the code editor is showing compile errors, try restarting the IDE). If the setup is correct, you should see something like the below as the output:
```
Hello from
____ _
| _ \ _ _| | _____
| | | | | | | |/ / _ \
| |_| | |_| | < __/
|____/ \__,_|_|\_\___|
```
Prerequisites: JDK 17 (it hasn't been tested on newer Java versions)

**Warning:** Keep the `src\main\java` folder as the root folder for Java files (i.e., don't rename those folders or move Java files to another folder outside of this folder path), as this is the default location some tools (e.g., Gradle) expect to find Java files.
1. Navigate to the project root directory
- the folder containing `/src`
1. Compile the Java files
- `javac -d out -sourcepath src/main/java src/main/java/bluebird/*.java src/main/java/bluebird/**/*.java`
- `-d out` tells Java to place compiled `.class` files inside the `out/` directory.
- `-sourcepath` ensures that Java compiles all necessary dependencies.
- The `*.java` and `**/*.java` ensure that all Java files in subdirectories are compiled.
1. Run the program
- `java -cp out bluebird.Main`

## Messing with JAR file

1. Create a JAR file from the compiled Java files
- `jar cfm myjar.jar manifest.txt -C out .`
- Replace `myjar.jar` with any suitable name
- `c` creates a new JAR file.
- `f` specifies the output filename (`myjar.jar`).
- `m` includes the manifest file.
- `-C out .` means “change to the `out/` directory and add all compiled files.”
1. Run the program from the JAR
- `java -jar myjar.jar`
- Replace `myjar.jar` with whatever name was chosen in the previous step
111 changes: 97 additions & 14 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,104 @@
# Duke User Guide
# Bluebird User Guide

// Update the title above to match the actual product name
![alt text][logo]

// Product screenshot goes here
[logo]: https://github.com/zavsky/ip/raw/master/docs/icon.png "product logo"

// Product intro goes here
Roses are red, violets are blue
I've spent too much time, and so did you too

Bluebird is not exactly the nicest program to talk to. For that, you have chatGPT. But hey, if its snarky behaviour isn't too off-putting, it may help you get all your work done in a more timely manner.

In all seriousness, it aims to organise and collect all your outstanding tasks, be it events or deadlines, so that you can better plan your day and accomplish more without forgetting a single detail. Hope you don't mind CLI, that is. Here's what you need to know to get started.


## Adding Tasks

Creation of a new task begins with the command `create` (or `c` for short). If no parameters are specified, the follow-up prompts will guide you to furnish the required (but arduous) information. A necessary evil.

### Add Todos

Todos are tasks without a specific date or time attached. Append the `add` command with `todo`/`t` or string them together to reduce keystrokes. Similarly, you may string the task description behind to create a todo in one command. Easy.

Syntax: `create todo [task_description]`

Example: `c t read the room`

### Add Deadlines

Deadlines attach a date to the created event. Type either `deadline` or `d` to specify this option. Optionally, include the task description and end date in a single line with the keyword `/by` or `/b` as a delimiter between the date and description.

Syntax: `create deadline [event_or_task_name] [/by end_date]`

Example: `c d fix the leak /b end of the week`

### Add Events

Events include a start and end time. The `event` or `e` option selects this task type. Task description follows the option with keywords `from`/`f` and `to`/`t` to separate the start and end time respectively. The order of the last two flags is interchangeable.

Syntax: `create event [event_name] [/from start_time] [/to end_time]`

Example: `c e fart concerto /f wed 5pm /to 8pm`

#### Note: leaving blanks

If certain details are not known during task creation, just leave them blank.


## Deleting Tasks

Tasks can be deleted via their indices shown when the `delete` option (or `d`) is specified. Alternatively, if you already know which task to remove, append the option with the index.

Example: `d 5`

### Batch delete

You may delete multiple tasks at the same time by separating the indices via spaces.

Syntax: `delete task_index [task_index ...]`

## Marking (and unmarking)

Mark a task's completion with `mark` or `m`, followed by the task index.

Example: `m 6`

### Batch marking

String the tasks for marking with a space delimiter to mark or unmark multiple tasks simultaneously.

Example: `mark 8 4 5 10`


## Undo last (accidental) commands

Use the `z` option to quickly undo the last task modification. Use it again to redo the undo. Strangely, the cycle continues forever.
Still curious about how it works? Deleted tasks will be added, marked tasks will be unmarked, you get it.


## Show task lists

The `list` command (or `l`) will present all saved tasks formatted as a list. If something horrible shows up, or you suddenly get a realisation why you were particularly free at that moment, it's not my fault.


## Get help string

Need help? All these syntax examples are accessible via the `help` keyword. You probably guessed it, but just `h` is fine too.


## Exiting the program

After a long day and the list has piled up, simply type `quit` to quit the program. No, you shall not shorthand with `q`, which will force quit all your unsaved apps. Just kidding.


## Future improvements

Modify existing tasks (in-place)
Batch delete all marked tasks
Search tasks via keyword
Basic search with filter options
Suppress query prompts (and fail quietly when insufficient or incorrect info is given)

## Adding deadlines

// Describe the action and its outcome.

Expand All @@ -19,12 +111,3 @@ Example: `keyword (optional arguments)`
```
expected output
```

## Feature ABC

// Feature details


## Feature XYZ

// Feature details
Binary file added docs/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions manifest.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Main-Class: bluebird.Main
10 changes: 0 additions & 10 deletions src/main/java/Duke.java

This file was deleted.

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

import java.security.SecureRandom;

/**
* Serves as a lookup for Bluebird's speech with formatting to
* align with the general UI
*/
public class Bluebird {
private static final SecureRandom random = new SecureRandom();

public Bluebird() {}

public String greetHello() {
return "Hello, I am Bluebird\n" +
"What can I do for you?\n\n";
}

public String scream() {
return "CAWWW\n";
}

public String curse() {
return "Oh my, either the density levels are off the charts or my reading comprehension is getting worse\n";
}

public String enthusiastic() {
return "Until next time...\n";
}

public String confused() {
return "Either no command or I don't quite get you... gotta speak clearer\n";
}

public String helpless() {
return "I cannot do that...";
}

/**
* Randomly picks an element from the supplied enum class and
* returns a value in the enum-class type
* <p>
* Taken from stackoverflow.com/questions/1972392/pick-a-random-value-from-an-enum
* from users Eldelshell and zuddduz.
* </p>
* @param clazz an enum class
* @return a random member of the enum
*/
public static <T extends Enum<?>> T randomEnum(Class<T> clazz) {
int x = random.nextInt(clazz.getEnumConstants().length);
return clazz.getEnumConstants()[x];
}
}
Loading