Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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.

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


public class Amadeus {
public static void main(String[] args) {
Task[] tasks = new Task[100];
int count = 0;
String logo =
"╔══════════════════════════════════════════════════════════════╗\n"
+ "║ ║\n"
+ "║ █████╗ ███╗ ███╗ █████╗ ██████╗ ███████╗██╗ ██╗███████╗ ║\n"
+ "║ ██╔══██╗████╗ ████║██╔══██╗██╔══██╗██╔════╝██║ ██║██╔════╝ ║\n"
+ "║ ███████║██╔████╔██║███████║██║ ██║█████╗ ██║ ██║███████╗ ║\n"
+ "║ ██╔══██║██║╚██╔╝██║██╔══██║██║ ██║██╔══╝ ██║ ██║╚════██║ ║\n"
+ "║ ██║ ██║██║ ╚═╝ ██║██║ ██║██████╔╝███████╗╚██████╔╝███████║ ║\n"
+ "║ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚═════╝ ╚══════╝ ╚═════╝ ╚══════╝ ║\n"
+ "║ ║\n"
+ "╚══════════════════════════════════════════════════════════════╝\n";


System.out.println("Hello from\n" + logo);

System.out.println("────────────────────────────────────────────────────────────────");
System.out.println("\uD83D\uDC4B Greetings. I am Amadeus, your cognitive assistant.");
System.out.println("I monitor divergences in world lines… and sometimes your mistakes.");
System.out.println("What knowledge do you seek today?");
System.out.println();
System.out.println("Here are the different mode : 1. Echo");
System.out.println(" 2. D-mail");
System.out.println(" 3. List");
System.out.print("Write the name of the command you wish use : ");

Scanner scanner = new Scanner(System.in);
while(true){
String answer = scanner.nextLine();
System.out.println();
if(answer.equals("Disconnect")){
System.out.println("────────────────────────────────────────────────────────────────");
System.out.println("System shutting down... awaiting next transmission.");
System.out.println("El Psy Kongroo.");
System.out.println("────────────────────────────────────────────────────────────────");
break;
}
else if(answer.equals("Echo")){
System.out.println("The Mad Scientist chose the option Echo");
System.out.println("Echo mode activated. Type 'Esc' to exit.");
while(true) {
String echo = scanner.nextLine();
if (echo.equals("Esc")) {
System.out.println("────────────────────────────────────────────────────────────────");
System.out.println("System shutting down... awaiting next transmission.");
System.out.println("El Psy Kongroo.");
System.out.println("────────────────────────────────────────────────────────────────");
break;
} else {
System.out.println("────────────────────────────────────────────────────────────────");
System.out.println("You just said : " + echo);
System.out.println("────────────────────────────────────────────────────────────────");
}

}

}
else if (answer.equals("D-mail")) {
System.out.println("The Mad Scientist chose to send a D-mail");
System.out.println("D-mail mode activated. Type 'El Psy Kongroo' to exit.");
while (true) {
String echo = scanner.nextLine();
if (echo.equals("El Psy Kongroo")) {
System.out.println("────────────────────────────────────────────────────────────────");
System.out.println("The SERN is spying us we need to disconnect ...");
System.out.println("⚠️ Your position has been compromised. flee immediately.");
System.out.println("El Psy Kongroo.");
System.out.println("World line shift imminent.");
System.out.println("────────────────────────────────────────────────────────────────");
break;
} else {
System.out.println("────────────────────────────────────────────────────────────────");
System.out.println("\uD83D\uDCF1 D-mail is sending to the past ...");
System.out.println("⚡ Time transmission in progress ...");
System.out.println("📧 Message received in world line 1.130205%: "+echo);
System.out.println("────────────────────────────────────────────────────────────────");
}
}
}
else if (answer.equals("List")) {
System.out.println("List mode activated. Type 'Bye' to exit.");
while (true) {
String echo = scanner.nextLine();
if (echo.equals("Bye")) {
System.out.println("The list printing is finished");
break;
} else if (echo.equals("list")) {
for (int i = 0; i < count; i++) {
System.out.println((i + 1) + ". " + tasks[i]);
}

} else if (echo.toLowerCase().startsWith("mark")) {
int idx = Integer.parseInt(echo.split(" ")[1]) - 1;
tasks[idx].markAsDone();
System.out.println("────────────────────────────────────────────────────────────────");
System.out.println("Nice! I've marked this task as done:");
System.out.println(" " + tasks[idx]);
System.out.println("────────────────────────────────────────────────────────────────");
} else if (echo.toLowerCase().startsWith("unmark")) {
int idx = Integer.parseInt(echo.split(" ")[1]) - 1;
tasks[idx].markAsUndone();
System.out.println("────────────────────────────────────────────────────────────────");
System.out.println("OK, I've marked this task as not done yet:");
System.out.println(" " + tasks[idx]);
System.out.println("────────────────────────────────────────────────────────────────");
} else {
if (count < 100) {
tasks[count] = new Task(echo);
count++;
System.out.println("────────────────────────────────────────────────────────────────");
System.out.println(" added: " + echo);
System.out.println("────────────────────────────────────────────────────────────────");
} else {
System.out.println("────────────────────────────────────────────────────────────────");
System.out.println("You already have too many things to do, finish some before adding more.");
System.out.println("────────────────────────────────────────────────────────────────");
}
}
}
}
}
scanner.close();
}
}

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

public class Task {
private final String description;
private boolean isDone;
public Task(String description) {
this.description = description;
this.isDone = false;
}

public void markAsDone() {
this.isDone = true;
}
public void markAsUndone() {
this.isDone = false;
}
public String getStatusIcon() {
return (isDone ? "[X]" : "[ ]");
}
@Override
public String toString() {
return getStatusIcon() + " " + description;
}
}