forked from nus-cs2113-AY2324S1/tp
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from ryanlohyr/ryan-createLayout
Create project base layout
- Loading branch information
Showing
5 changed files
with
69 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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()); | ||
} | ||
|
||
} |
40 changes: 40 additions & 0 deletions
40
src/main/java/seedu/duke/controllers/ModulePlannerController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
CS1010S | ||
MA1508 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package seedu.duke.models; | ||
public class Module { | ||
//defining your module object etc | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
|
||
} |