Skip to content
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
90c8452
Level-0 Increment
DarkDragoon2002 Aug 22, 2024
6027a2d
Level-1
DarkDragoon2002 Aug 28, 2024
0d164dd
Level-2
DarkDragoon2002 Aug 28, 2024
dded6bf
Level-3
DarkDragoon2002 Aug 28, 2024
d0d0bda
A-CodingStandard
DarkDragoon2002 Aug 28, 2024
a43c3b2
Added ToDo, Deadline and Event
DarkDragoon2002 Sep 6, 2024
6a7f020
Added UI Text Testing
DarkDragoon2002 Sep 7, 2024
0d50273
Implemented Deadline and Event Constructor Exceptions
DarkDragoon2002 Sep 10, 2024
cb16bf3
Implemented ToDo Constructor Exceptions and Error Catching for chat c…
DarkDragoon2002 Sep 10, 2024
913e641
Implemented Packages
DarkDragoon2002 Sep 10, 2024
f0c0fab
Added Comments
DarkDragoon2002 Sep 12, 2024
36dbaff
Merge pull request #1 from DarkDragoon2002/branch-A-Packages
DarkDragoon2002 Sep 12, 2024
2d8b65a
Implemented ArrayList
DarkDragoon2002 Sep 19, 2024
5b59c6f
Implemented delete function & cleaned up code
DarkDragoon2002 Sep 19, 2024
c4ca544
Implemented Data Writing System
DarkDragoon2002 Sep 20, 2024
f0b78b9
Merge pull request #2 from DarkDragoon2002/branch-Level-6
DarkDragoon2002 Sep 20, 2024
0941170
Merge branch 'master' into branch-Level-7
DarkDragoon2002 Sep 20, 2024
9672976
Merge pull request #3 from DarkDragoon2002/branch-Level-7
DarkDragoon2002 Sep 20, 2024
2d5e67e
Bugfix and Created JAR file
DarkDragoon2002 Sep 20, 2024
c88fc8c
Migrated UI to separate Class
DarkDragoon2002 Oct 8, 2024
e2f954e
Migrate TaskList Functions from Task
DarkDragoon2002 Oct 9, 2024
1e844eb
Migrated Parser functions from Juan
DarkDragoon2002 Oct 9, 2024
44b8d55
Fixed Corrupted Data Handling
DarkDragoon2002 Oct 9, 2024
43e739f
Extracted Command Handling from Parser and Followed Good Coding Princ…
DarkDragoon2002 Oct 9, 2024
075bdcf
Merge pull request #4 from DarkDragoon2002/master
DarkDragoon2002 Oct 9, 2024
8eff0ee
Implemented DateTime feature and Updated Exception Handling
DarkDragoon2002 Oct 9, 2024
01d0c9d
Implement find function
DarkDragoon2002 Oct 9, 2024
cdf58d0
Merge pull request #5 from DarkDragoon2002/branch-Level-8
DarkDragoon2002 Oct 9, 2024
8d0bb25
Merge branch 'master' into branch-Level-9
DarkDragoon2002 Oct 9, 2024
4e5f9fa
Merge pull request #6 from DarkDragoon2002/branch-Level-9
DarkDragoon2002 Oct 9, 2024
2935ec3
Improved Code Quality
DarkDragoon2002 Oct 9, 2024
e439f74
Merge branch 'master' of https://github.com/DarkDragoon2002/ip
DarkDragoon2002 Oct 9, 2024
936c109
Updated UI-Text-Testing Files
DarkDragoon2002 Oct 9, 2024
42cbb2c
Updated JavaDoc Comments
DarkDragoon2002 Oct 9, 2024
364eab3
Merge pull request #7 from DarkDragoon2002/branch-A-JavaDoc
DarkDragoon2002 Oct 9, 2024
e64f9dc
Resolved Merge Conflicts
DarkDragoon2002 Oct 9, 2024
16bf1b5
Merge branch 'master' of https://github.com/DarkDragoon2002/ip
DarkDragoon2002 Oct 9, 2024
97be193
Updated README.md
DarkDragoon2002 Oct 10, 2024
45abc71
Update README.md
DarkDragoon2002 Oct 10, 2024
4175b23
Update README.md
DarkDragoon2002 Oct 10, 2024
98d3df5
Update README.md
DarkDragoon2002 Oct 10, 2024
246fbcb
Storage Bug Fix
DarkDragoon2002 Oct 10, 2024
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
10 changes: 0 additions & 10 deletions src/main/java/Duke.java

This file was deleted.

80 changes: 80 additions & 0 deletions src/main/java/Juan.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import java.util.Scanner;

public class Juan {
public static void main(String[] args) {
lineMessage();
helloMessage();
lineMessage();

boolean continueChatting = true;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Boolean variables/methods should be named to sound like booleans.
The same error is present in other parts of the code.

while (continueChatting) {
continueChatting = chatFeature();
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better to extract these lines of code?

byeMessage();
lineMessage();
}
public static boolean chatFeature(){

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As it's a method, should it be named with a verb?

// Less efficient to create a new scanner everytime but code is much neater
// If return True means continue
// Else End

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment looks like a note to self and should not be here


Scanner scanner = new Scanner(System.in);
String line = scanner.nextLine();
lineMessage();

if (line.equals("bye")) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May the command words also be variables, for later use or easier management?

return false;
} else if (line.equals("list")) {
Task.printTasksList();
return true;
}

// Check for mark and unmark or just add task
String[] parts = line.split(" ");
if (parts[0].equals("mark")){
// Mark
int taskIndex = Integer.parseInt(parts[1]) - 1;
Task.mark(taskIndex);
} else if (parts[0].equals("unmark")){
// Unmark
int taskIndex = Integer.parseInt(parts[1]) - 1;
Task.unmark(taskIndex);
} else {
// else add task
Task newTask = new Task(line);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this part be extracted out?

lineMessage();
return true;
}

// Message Functions for cleaner main Function
public static void lineMessage() {
String line = "____________________________________________________________\n";
System.out.print(line);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the messages, should it be static variables instead and what the methods do is just printing it out?

public static void helloMessage() {
String greeting =
" ._-'-_ .\n" +
" . ' /_-_-_\\ ` .\n" +
" .' |-_-_-_-| `.\n" +
" ( `.-_-_-.' )\n" +
" !`. .'!\n" +
" ! ` . . ' !\n" +
" ! ! ! ! ! ! ! ! !\n" +
" / / \\ \\\n" +
" _-| \\___ ___/ /-_\n" +
" (_ )__\\_)\\(_/__( _)\n" +
" ))))\\X\\ ((((\n" +
" \\/ \\/ \n" +

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this logo, it is very cute!

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ASCII art rules! 👍

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love the logo!

"Hola Amigo, I am Juan Cervantes Salamanca from Michoacan \n" +
"Welcome to la familia \n" +
"How can we help you? \n";
System.out.print(greeting);
}
public static void byeMessage() {
String bye = "Adios amigo, la familia will miss you\n";
System.out.print(bye);
}

}
66 changes: 66 additions & 0 deletions src/main/java/Task.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
public class Task {

// Keep track of tasks
private static Task[] tasks = new Task[100];
private static int taskNumber = 0;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps a better name can be made here, like taskCount?


// Object specific variables
public String taskString;
public boolean taskDone = false;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the boolean name here be more intuitive like in the Java coding standard?


// Constructor Function
public Task(String taskString) {
this.taskString = taskString;
tasks[taskNumber] = this;
taskNumber++;
System.out.println("Muy Bien, work hard compadre!");
System.out.println("I've Added the Task:");
System.out.println(taskString);
}

// Class mark function
public static void mark(int taskIndex){
if (taskIndex < 0 || taskIndex >= taskNumber){ // Validity Check
System.out.println("Not possible Amigo, try again");
return;
}
tasks[taskIndex].taskDone = true;
System.out.println("Fantastica!!!! I marked it:");
System.out.println(tasks[taskIndex].checkboxString());
}

// Class unmark function
public static void unmark(int taskIndex){
if (taskIndex < 0 || taskIndex >= taskNumber){ // Validity Check
System.out.println("Not possible Amigo, try again");
return;
}
tasks[taskIndex].taskDone = false;
System.out.println("Ay Caramba, I unmarked it:");
System.out.println(tasks[taskIndex].checkboxString());
}

// Function to create String with Checkbox and Task
public String checkboxString(){
String returnString = "[";
if (this.taskDone){
returnString += "X";
} else {
returnString += " ";
}
returnString += "] " + this.taskString;
return returnString;
}

// Function to print out task checklist
public static void printTasksList(){
if (taskNumber == 0){
System.out.println("Por Favor? Nothing Here");
} else {
System.out.println("Si compinche, your tasks:");
for (int i = 0; i < taskNumber; i++){
System.out.println((i+1) + "." + tasks[i].checkboxString());
}
}
}
}