diff --git a/.gitignore b/.gitignore index 2873e189e1..2b04b28136 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ /.idea/ /out/ /*.iml +/*.class # Gradle build files /.gradle/ diff --git a/build.gradle b/build.gradle index d5e548e85f..8063a8adb8 100644 --- a/build.gradle +++ b/build.gradle @@ -29,7 +29,7 @@ test { } application { - mainClass = "seedu.duke.Duke" + mainClass = "Inka" } shadowJar { diff --git a/src/main/java/Inka.class b/src/main/java/Inka.class new file mode 100644 index 0000000000..d8aee0ed39 Binary files /dev/null and b/src/main/java/Inka.class differ diff --git a/src/main/java/Inka.java b/src/main/java/Inka.java new file mode 100644 index 0000000000..247f96f2b9 --- /dev/null +++ b/src/main/java/Inka.java @@ -0,0 +1,26 @@ +import utils.parser.Parser; +import utils.userinterface.UserInterface; + +public class Inka { + private final UserInterface ui; + private final Parser parser; + public Inka() { + ui = new UserInterface(); + parser = new Parser(); + } + + public void run() { + ui.printGreeting(); + + //fill in the method here + //while(parser.getIsExecuting()) { + // String fullCommand = ui.getCommand(); + //} + + ui.printBye(); + } + + public static void main(String[] args) { + new Inka().run(); + } +} diff --git a/src/main/java/model/card/Card.java b/src/main/java/model/card/Card.java new file mode 100644 index 0000000000..1c734e49fd --- /dev/null +++ b/src/main/java/model/card/Card.java @@ -0,0 +1,10 @@ +package model.card; + +//to be made into an abstract class containing a few types of Cards later, for now just a single Card will do +public class Card { + private int uuid ; //to be made into a hash later + private String question; + private String answer; + + //implement method such as toPrint() or any other appropriate method here +} diff --git a/src/main/java/model/cardlist/CardList.java b/src/main/java/model/cardlist/CardList.java new file mode 100644 index 0000000000..4e65cb4fdc --- /dev/null +++ b/src/main/java/model/cardlist/CardList.java @@ -0,0 +1,12 @@ +package model.cardlist; + +import model.card.Card; +import java.util.ArrayList; + +public class CardList { + private ArrayList cards ; + + CardList() { + this.cards = new ArrayList<>(); + } +} diff --git a/src/main/java/utils/enums/StringArt.class b/src/main/java/utils/enums/StringArt.class new file mode 100644 index 0000000000..7f0624d5d3 Binary files /dev/null and b/src/main/java/utils/enums/StringArt.class differ diff --git a/src/main/java/utils/enums/StringArt.java b/src/main/java/utils/enums/StringArt.java new file mode 100644 index 0000000000..87f8c9cf2c --- /dev/null +++ b/src/main/java/utils/enums/StringArt.java @@ -0,0 +1,22 @@ +package utils.enums; + +public enum StringArt { + INKA( + ".___ __ \n" + + "| | ____ | | _______ \n" + + "| |/ \\| |/ /\\__ \\ \n" + + "| | | \\ < / __ \\_\n" + + "|___|___| /__|_ \\(____ /\n" + + " \\/ \\/ \\/ "), + BYE( + " ____ _ _ ____ _ \n" + + "( _ \\( \\/ )( __) / \\ \n" + + " ) _ ( ) / ) _) \\_/ \n" + + "(____/(__/ (____) (_) " + ); + + public final String art; + StringArt(String art) { + this.art = art; + } +} diff --git a/src/main/java/utils/parser/Parser.class b/src/main/java/utils/parser/Parser.class new file mode 100644 index 0000000000..583e71710e Binary files /dev/null and b/src/main/java/utils/parser/Parser.class differ diff --git a/src/main/java/utils/parser/Parser.java b/src/main/java/utils/parser/Parser.java new file mode 100644 index 0000000000..13c0e854c9 --- /dev/null +++ b/src/main/java/utils/parser/Parser.java @@ -0,0 +1,15 @@ +package utils.parser; + +public class Parser { + private boolean isExecuting; + + public Parser() { + this.isExecuting = true; + } + + public boolean getIsExecuting() { + return isExecuting; + } + + //add all parser methods here +} diff --git a/src/main/java/utils/userinterface/UserInterface.class b/src/main/java/utils/userinterface/UserInterface.class new file mode 100644 index 0000000000..4640c265f6 Binary files /dev/null and b/src/main/java/utils/userinterface/UserInterface.class differ diff --git a/src/main/java/utils/userinterface/UserInterface.java b/src/main/java/utils/userinterface/UserInterface.java new file mode 100644 index 0000000000..3b610ccc40 --- /dev/null +++ b/src/main/java/utils/userinterface/UserInterface.java @@ -0,0 +1,48 @@ +package utils.userinterface; + +import utils.enums.StringArt; + +import java.util.Scanner; + +public class UserInterface { + private static final int LINE_LENGTH = 100; + private static final String INKA_ART = + ".___ __ \n" + + "| | ____ | | _______ \n" + + "| |/ \\| |/ /\\__ \\ \n" + + "| | | \\ < / __ \\_\n" + + "|___|___| /__|_ \\(____ /\n" + + " \\/ \\/ \\/ "; + + private static final String BYE_ART = + " ____ _ _ ____ _ \n" + + "( _ \\( \\/ )( __) / \\ \n" + + " ) _ ( ) / ) _) \\_/ \n" + + "(____/(__/ (____) (_) "; + private final Scanner scanner; + public UserInterface() { + scanner = new Scanner(System.in); + } + + public String getCommand() { + return scanner.nextLine(); + } + + public void printLine() { + System.out.println("_".repeat(LINE_LENGTH)); + } + + public void printGreeting() { + printLine(); + System.out.println(StringArt.INKA.art); + System.out.println("Welcome to Inka ! Say no more to failing exams as Inka will be your lord and saviour!"); + printLine(); + } + + public void printBye() { + printLine(); + System.out.println(StringArt.BYE.art); + System.out.println("\n Bye! All the best for your exams man!!!"); + printLine(); + } +} diff --git a/text-ui-test/EXPECTED.TXT b/text-ui-test/EXPECTED.TXT index 892cb6cae7..79c073f18d 100644 --- a/text-ui-test/EXPECTED.TXT +++ b/text-ui-test/EXPECTED.TXT @@ -1,9 +1,17 @@ -Hello from - ____ _ -| _ \ _ _| | _____ -| | | | | | | |/ / _ \ -| |_| | |_| | < __/ -|____/ \__,_|_|\_\___| +____________________________________________________________________________________________________ +.___ __ +| | ____ | | _______ +| |/ \| |/ /\__ \ +| | | \ < / __ \_ +|___|___| /__|_ \(____ / + \/ \/ \/ +Welcome to Inka ! Say no more to failing exams as Inka will be your lord and saviour! +____________________________________________________________________________________________________ +____________________________________________________________________________________________________ + ____ _ _ ____ _ +( _ \( \/ )( __) / \ + ) _ ( ) / ) _) \_/ +(____/(__/ (____) (_) -What is your name? -Hello James Gosling + Bye! All the best for your exams man!!! +____________________________________________________________________________________________________ diff --git a/text-ui-test/input.txt b/text-ui-test/input.txt index f6ec2e9f95..e69de29bb2 100644 --- a/text-ui-test/input.txt +++ b/text-ui-test/input.txt @@ -1 +0,0 @@ -James Gosling \ No newline at end of file