diff --git a/src/main/java/seedu/duke/Duke.java b/src/main/java/seedu/duke/Duke.java index 5c74e68d59..90a50d62a9 100644 --- a/src/main/java/seedu/duke/Duke.java +++ b/src/main/java/seedu/duke/Duke.java @@ -1,21 +1,14 @@ package seedu.duke; - -import java.util.Scanner; - +import seedu.duke.controllers.ModulePlannerController; public class Duke { /** * Main entry-point for the java.duke.Duke application. */ + //main should have basically no code except start public static void main(String[] args) { - String logo = " ____ _ \n" - + "| _ \\ _ _| | _____ \n" - + "| | | | | | | |/ / _ \\\n" - + "| |_| | |_| | < __/\n" - + "|____/ \\__,_|_|\\_\\___|\n"; - System.out.println("Hello from\n" + logo); - System.out.println("What is your name?"); + ModulePlannerController controller = new ModulePlannerController(); + controller.start(); - Scanner in = new Scanner(System.in); - System.out.println("Hello " + in.nextLine()); } + } diff --git a/src/main/java/seedu/duke/controllers/ModulePlannerController.java b/src/main/java/seedu/duke/controllers/ModulePlannerController.java new file mode 100644 index 0000000000..902074d70a --- /dev/null +++ b/src/main/java/seedu/duke/controllers/ModulePlannerController.java @@ -0,0 +1,40 @@ +package seedu.duke.controllers; +import seedu.duke.views.CommandLineView; + +import java.util.Scanner; + +public class ModulePlannerController { + private CommandLineView view; + public ModulePlannerController(){ + this.view = new CommandLineView(); + } + public void start(){ + view.displayWelcome(); + Scanner in = new Scanner(System.in); + String userInput = in.nextLine(); + + while(!userInput.equals("Bye")){ + + String[] words = userInput.split(" "); + + String initialWord = words[0]; + + switch(initialWord){ + case "hi":{ + view.displayMessage("can put the commands here"); + break; + } + case "hello":{ + view.displayMessage("yup"); + break; + } + default:{ + view.displayMessage("Hello " + userInput); + break; + } + + } + userInput = in.nextLine(); + } + } +} diff --git a/src/main/java/seedu/duke/models/Duke.txt b/src/main/java/seedu/duke/models/Duke.txt new file mode 100644 index 0000000000..5d8266cc98 --- /dev/null +++ b/src/main/java/seedu/duke/models/Duke.txt @@ -0,0 +1,2 @@ +CS1010S +MA1508 \ No newline at end of file diff --git a/src/main/java/seedu/duke/models/Module.java b/src/main/java/seedu/duke/models/Module.java new file mode 100644 index 0000000000..b27279233b --- /dev/null +++ b/src/main/java/seedu/duke/models/Module.java @@ -0,0 +1,4 @@ +package seedu.duke.models; +public class Module { + //defining your module object etc +} diff --git a/src/main/java/seedu/duke/views/CommandLineView.java b/src/main/java/seedu/duke/views/CommandLineView.java new file mode 100644 index 0000000000..d881b8a75a --- /dev/null +++ b/src/main/java/seedu/duke/views/CommandLineView.java @@ -0,0 +1,18 @@ +package seedu.duke.views; + +public class CommandLineView { + public void displayWelcome(){ + String logo = " ____ _ \n" + + "| _ \\ _ _| | _____ \n" + + "| | | | | | | |/ / _ \\\n" + + "| |_| | |_| | < __/\n" + + "|____/ \\__,_|_|\\_\\___|\n"; + System.out.println("Hello from\n" + logo); + System.out.println("What is your name?"); + } + + public void displayMessage(String message) { + System.out.println(message); + } + +}