From 0959c45e61bda772f90eead2c08ad881ef3c8080 Mon Sep 17 00:00:00 2001 From: Supermjork Date: Thu, 2 Jun 2022 15:19:24 +0200 Subject: [PATCH 1/9] Switch to add ingredients and compile the full recipe. --- .idea/misc.xml | 2 +- Icing-On-Graph.iml | 26 ++++++++++++++ src/RecipeInstructions.java | 72 +++++++++++++++++++++++++++++++++++++ 3 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 src/RecipeInstructions.java diff --git a/.idea/misc.xml b/.idea/misc.xml index 07115cd..f3f4fc6 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/Icing-On-Graph.iml b/Icing-On-Graph.iml index 1bb3d1a..b88e7c6 100644 --- a/Icing-On-Graph.iml +++ b/Icing-On-Graph.iml @@ -23,5 +23,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/RecipeInstructions.java b/src/RecipeInstructions.java new file mode 100644 index 0000000..cad78b3 --- /dev/null +++ b/src/RecipeInstructions.java @@ -0,0 +1,72 @@ +import java.awt.image.AreaAveragingScaleFilter; +import java.util.ArrayList; +import java.util.Scanner; + +public class RecipeInstructions { + public static void main(String[] args) { + int usrChoice; + + ArrayList ingredients = new ArrayList<>(); + RecipeTree fullInstructions = new RecipeTree(); + + do { + Scanner userOption = new Scanner(System.in); + + System.out.println("What would you like to do?\n1.Add Ingredient\n2.Mix"); + usrChoice = userOption.nextInt(); + + // Switch case for user's choice + switch (usrChoice) { + case 1: + // Init 3 scanners because usually scanners crash on me with multiple input types lmao + Scanner ingredientAddAmount = new Scanner(System.in); // Init Scanner for Added amount + Scanner ingredientAddName = new Scanner(System.in); // Init Another Scanner for Name + Scanner ingredientAddPortion = new Scanner(System.in); // Init Yet another Scanner for Portion + + System.out.print("Enter how many ingredients you're adding: "); + int amountIngredient = ingredientAddAmount.nextInt(); // Defining how many ingredients will be added + + for(int i = 0; i < amountIngredient; i++) { + // Getting Ingredient Name + System.out.println("Enter ingredient Name"); + String ingredientName = ingredientAddName.nextLine(); + + // Getting Ingredient Portion size + System.out.println("\nEnter ingredient portion"); + double ingredientPortion = ingredientAddPortion.nextDouble(); + + // Creating the Ingredient's node and putting it into array list + // for safe keeping and later use + RecipeNode newIngredient = new RecipeNode(ingredientName, ingredientPortion); + fullInstructions.addNode((RecipeNode) null, newIngredient); + } + break; + case 2: + Scanner ingredientNames = new Scanner(System.in); // Scanner for ingredients' names + String userIngredients; // String poo + ArrayList bowl = new ArrayList<>(); // Mixing bowl for ingredients obviously + + do { + System.out.println("Enter ingredient names to be mixed (type done to exit)"); + userIngredients = ingredientNames.nextLine(); + + for(RecipeNode ingredient : ingredients) { + if(userIngredients.equals(ingredient.getIngredient())) { + bowl.add(ingredient); + break; + } + } + } while (!userIngredients.equalsIgnoreCase("done")); + + RecipeNode mixture = new RecipeNode(bowl.get(0) + " mix", 69); + ingredients.add(mixture); + + for(RecipeNode childIngredient : bowl) { + mixture.addChild(childIngredient); + childIngredient.parent = mixture; + } + + } + } while(usrChoice != -1); + } +} From bfb154873e9f27924af9d4fac5454f308ba84f56 Mon Sep 17 00:00:00 2001 From: Libkyy Date: Thu, 2 Jun 2022 18:38:31 +0200 Subject: [PATCH 2/9] My brain hurts :D --- .idea/misc.xml | 2 +- src/RecipeInstructions.java | 134 ++++++++++++++++++++++++++++++++---- src/RecipeNode.java | 4 ++ 3 files changed, 125 insertions(+), 15 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index f3f4fc6..07115cd 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/src/RecipeInstructions.java b/src/RecipeInstructions.java index cad78b3..cc795a7 100644 --- a/src/RecipeInstructions.java +++ b/src/RecipeInstructions.java @@ -1,32 +1,39 @@ -import java.awt.image.AreaAveragingScaleFilter; +import org.junit.jupiter.api.Test; + import java.util.ArrayList; import java.util.Scanner; +import java.util.regex.Pattern; -public class RecipeInstructions { - public static void main(String[] args) { +public class RecipeInstructions +{ + public static void main(String[] args) + { int usrChoice; ArrayList ingredients = new ArrayList<>(); RecipeTree fullInstructions = new RecipeTree(); - do { + do + { Scanner userOption = new Scanner(System.in); System.out.println("What would you like to do?\n1.Add Ingredient\n2.Mix"); usrChoice = userOption.nextInt(); // Switch case for user's choice - switch (usrChoice) { + switch (usrChoice) + { case 1: // Init 3 scanners because usually scanners crash on me with multiple input types lmao - Scanner ingredientAddAmount = new Scanner(System.in); // Init Scanner for Added amount - Scanner ingredientAddName = new Scanner(System.in); // Init Another Scanner for Name + Scanner ingredientAddAmount = new Scanner(System.in); // Init Scanner for Added amount + Scanner ingredientAddName = new Scanner(System.in); // Init Another Scanner for Name Scanner ingredientAddPortion = new Scanner(System.in); // Init Yet another Scanner for Portion System.out.print("Enter how many ingredients you're adding: "); int amountIngredient = ingredientAddAmount.nextInt(); // Defining how many ingredients will be added - for(int i = 0; i < amountIngredient; i++) { + for (int i = 0; i < amountIngredient; i++) + { // Getting Ingredient Name System.out.println("Enter ingredient Name"); String ingredientName = ingredientAddName.nextLine(); @@ -38,7 +45,8 @@ public class RecipeInstructions { // Creating the Ingredient's node and putting it into array list // for safe keeping and later use RecipeNode newIngredient = new RecipeNode(ingredientName, ingredientPortion); - fullInstructions.addNode((RecipeNode) null, newIngredient); +// fullInstructions.addNode((RecipeNode) null, newIngredient); + ingredients.add(newIngredient); } break; case 2: @@ -46,12 +54,15 @@ public class RecipeInstructions { String userIngredients; // String poo ArrayList bowl = new ArrayList<>(); // Mixing bowl for ingredients obviously - do { + do + { System.out.println("Enter ingredient names to be mixed (type done to exit)"); userIngredients = ingredientNames.nextLine(); - for(RecipeNode ingredient : ingredients) { - if(userIngredients.equals(ingredient.getIngredient())) { + for (RecipeNode ingredient : ingredients) + { + if (userIngredients.equals(ingredient.getIngredient())) + { bowl.add(ingredient); break; } @@ -61,12 +72,107 @@ public class RecipeInstructions { RecipeNode mixture = new RecipeNode(bowl.get(0) + " mix", 69); ingredients.add(mixture); - for(RecipeNode childIngredient : bowl) { + for (RecipeNode childIngredient : bowl) + { mixture.addChild(childIngredient); childIngredient.parent = mixture; } } - } while(usrChoice != -1); + } while (usrChoice != -1); } + + //Magical Regex + public static boolean patternMatch(String pattern, String input) + { + Pattern p = Pattern.compile(pattern, Pattern.CASE_INSENSITIVE); + return p.matcher(input).find(); + } + + // This creates an action + children + public static void RecipeCreation() + { + //New tree who dis + RecipeTree fullInstructions = new RecipeTree(); + //Stinky Scanner please remove or something idk + //Maybe make the method take a string in or somethiong :D + Scanner input = new Scanner(System.in); + String userInput; + //Need to not hardcode verbs maybe a global variable for it? etc etc + String[] verbs = {"add", "mix"}; + //init this shit + int currentNumber = 0; + String currentIngredient = null; + //Useless sout lol + System.out.println("Enter instruction: "); +// userInput = input.nextLine(); + //this was simulating user input for the tests below + userInput = "mix 3 eggs and 2 milk"; + //this is where it gets juicy + //FIRST WE FIND A VERB FOR THE ACTION + for (String verb : verbs) + { + //we regex the input for the thing + if (patternMatch(verb, userInput)) + { + //get Action + RecipeNode newAction = new RecipeNode(verb, 0); + //Split after verb + //this is where we split the string + String[] split = userInput.split(verb); + //We get the words only POG + String[] words = split[1].split(" "); + construct_children(newAction, words); + //we add the thing to the tree (this also needs to be checked for WHERE it gets added) + fullInstructions.addNode((RecipeNode) null, newAction); + } + fullInstructions.printTree(); + } + + } + + //MMMMM children yes??? + //Seriously this takes the action node and the rest of the words in sentence and adds them as children + public static void construct_children(RecipeNode node, String[] words) + { + int Number = 0; + String Ingredient = null; + for (String word : words) + { + if (word.matches("\\d+")) + { + Number = Integer.parseInt(word); + } else if (word.matches("[a-zA-Z]+") && !word.equals("and")) + { + Ingredient = word; + } + if (Number != 0 && Ingredient != null) + { + RecipeNode newIngredient = new RecipeNode(Ingredient, Number); + node.addChild(newIngredient); + newIngredient.parent = node; + Number = 0; + Ingredient = null; + } + } + + } + + + //Tests duh they work :DDDDDD + @Test + void testRecipeCreation() + { + RecipeCreation(); + } + @Test + void testconstruct_children() + { + RecipeNode node = new RecipeNode("", 0); + String[] words = {"1", "eggs", "and", "2", "milk"}; + construct_children(node, words); + System.out.println(node.getChildren()); + } + + } diff --git a/src/RecipeNode.java b/src/RecipeNode.java index 36624d5..9f049c5 100644 --- a/src/RecipeNode.java +++ b/src/RecipeNode.java @@ -11,6 +11,10 @@ public class RecipeNode { this.ingredient = ingredient; this.portion = portion; } + public RecipeNode(String name) + { + this.ingredient = name; + } public void setIngredient(String ingredient) { this.ingredient = ingredient; From d7031bd56378ecb3cebfec89c23255c706dd1e92 Mon Sep 17 00:00:00 2001 From: Supermjork Date: Thu, 2 Jun 2022 19:47:01 +0200 Subject: [PATCH 3/9] Regex implemented (Linly brain went brr), Added more actions, RecipeCreation takes string as input now. --- .idea/misc.xml | 2 +- src/RecipeInstructions.java | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index 07115cd..f3f4fc6 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/src/RecipeInstructions.java b/src/RecipeInstructions.java index cc795a7..772855f 100644 --- a/src/RecipeInstructions.java +++ b/src/RecipeInstructions.java @@ -90,7 +90,7 @@ public class RecipeInstructions } // This creates an action + children - public static void RecipeCreation() + public static void RecipeCreation(String instructionIn) { //New tree who dis RecipeTree fullInstructions = new RecipeTree(); @@ -99,7 +99,8 @@ public class RecipeInstructions Scanner input = new Scanner(System.in); String userInput; //Need to not hardcode verbs maybe a global variable for it? etc etc - String[] verbs = {"add", "mix"}; + String[] verbs = {"add", "mix", "stir", "wait", "bake", "heat", "sift", "boil", "melt", "fry", "cool", + "remove", "eat", "cut"}; //init this shit int currentNumber = 0; String currentIngredient = null; @@ -163,7 +164,7 @@ public class RecipeInstructions @Test void testRecipeCreation() { - RecipeCreation(); + RecipeCreation("disNotRealOnlyToAvoidErrorTrustDuud"); } @Test void testconstruct_children() From ba3406d29be250521e4d12d49ea76effba4a4459 Mon Sep 17 00:00:00 2001 From: Supermjork Date: Thu, 2 Jun 2022 20:06:42 +0200 Subject: [PATCH 4/9] Instruction go brrrr. --- src/RecipeInstructions.java | 81 +++++-------------------------------- 1 file changed, 11 insertions(+), 70 deletions(-) diff --git a/src/RecipeInstructions.java b/src/RecipeInstructions.java index 772855f..a381f7a 100644 --- a/src/RecipeInstructions.java +++ b/src/RecipeInstructions.java @@ -8,78 +8,20 @@ public class RecipeInstructions { public static void main(String[] args) { - int usrChoice; + String userInstruction; ArrayList ingredients = new ArrayList<>(); RecipeTree fullInstructions = new RecipeTree(); do { - Scanner userOption = new Scanner(System.in); + System.out.println("Enter instruction: "); + Scanner userInput = new Scanner(System.in); + userInstruction = userInput.nextLine(); - System.out.println("What would you like to do?\n1.Add Ingredient\n2.Mix"); - usrChoice = userOption.nextInt(); + RecipeCreation(userInstruction); - // Switch case for user's choice - switch (usrChoice) - { - case 1: - // Init 3 scanners because usually scanners crash on me with multiple input types lmao - Scanner ingredientAddAmount = new Scanner(System.in); // Init Scanner for Added amount - Scanner ingredientAddName = new Scanner(System.in); // Init Another Scanner for Name - Scanner ingredientAddPortion = new Scanner(System.in); // Init Yet another Scanner for Portion - - System.out.print("Enter how many ingredients you're adding: "); - int amountIngredient = ingredientAddAmount.nextInt(); // Defining how many ingredients will be added - - for (int i = 0; i < amountIngredient; i++) - { - // Getting Ingredient Name - System.out.println("Enter ingredient Name"); - String ingredientName = ingredientAddName.nextLine(); - - // Getting Ingredient Portion size - System.out.println("\nEnter ingredient portion"); - double ingredientPortion = ingredientAddPortion.nextDouble(); - - // Creating the Ingredient's node and putting it into array list - // for safe keeping and later use - RecipeNode newIngredient = new RecipeNode(ingredientName, ingredientPortion); -// fullInstructions.addNode((RecipeNode) null, newIngredient); - ingredients.add(newIngredient); - } - break; - case 2: - Scanner ingredientNames = new Scanner(System.in); // Scanner for ingredients' names - String userIngredients; // String poo - ArrayList bowl = new ArrayList<>(); // Mixing bowl for ingredients obviously - - do - { - System.out.println("Enter ingredient names to be mixed (type done to exit)"); - userIngredients = ingredientNames.nextLine(); - - for (RecipeNode ingredient : ingredients) - { - if (userIngredients.equals(ingredient.getIngredient())) - { - bowl.add(ingredient); - break; - } - } - } while (!userIngredients.equalsIgnoreCase("done")); - - RecipeNode mixture = new RecipeNode(bowl.get(0) + " mix", 69); - ingredients.add(mixture); - - for (RecipeNode childIngredient : bowl) - { - mixture.addChild(childIngredient); - childIngredient.parent = mixture; - } - - } - } while (usrChoice != -1); + } while (userInstruction.equalsIgnoreCase("done")); } //Magical Regex @@ -96,7 +38,7 @@ public class RecipeInstructions RecipeTree fullInstructions = new RecipeTree(); //Stinky Scanner please remove or something idk //Maybe make the method take a string in or somethiong :D - Scanner input = new Scanner(System.in); + // Scanner input = new Scanner(System.in); <-- Commented remove for testing String userInput; //Need to not hardcode verbs maybe a global variable for it? etc etc String[] verbs = {"add", "mix", "stir", "wait", "bake", "heat", "sift", "boil", "melt", "fry", "cool", @@ -104,23 +46,22 @@ public class RecipeInstructions //init this shit int currentNumber = 0; String currentIngredient = null; - //Useless sout lol - System.out.println("Enter instruction: "); + //Useless sout lol // userInput = input.nextLine(); //this was simulating user input for the tests below - userInput = "mix 3 eggs and 2 milk"; + // userInput = "mix 3 eggs and 2 milk"; <-- Commented remove for testing //this is where it gets juicy //FIRST WE FIND A VERB FOR THE ACTION for (String verb : verbs) { //we regex the input for the thing - if (patternMatch(verb, userInput)) + if (patternMatch(verb, instructionIn)) { //get Action RecipeNode newAction = new RecipeNode(verb, 0); //Split after verb //this is where we split the string - String[] split = userInput.split(verb); + String[] split = instructionIn.split(verb); //We get the words only POG String[] words = split[1].split(" "); construct_children(newAction, words); From 5d6a7b3fa9cbd7eb4b6fb0587f4e5a767ef1c287 Mon Sep 17 00:00:00 2001 From: Supermjork Date: Thu, 2 Jun 2022 20:08:54 +0200 Subject: [PATCH 5/9] Instructions go brrrr. --- src/RecipeInstructions.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/RecipeInstructions.java b/src/RecipeInstructions.java index a381f7a..ec89917 100644 --- a/src/RecipeInstructions.java +++ b/src/RecipeInstructions.java @@ -73,7 +73,7 @@ public class RecipeInstructions } - //MMMMM children yes??? + //MMMMM children yes?? //Seriously this takes the action node and the rest of the words in sentence and adds them as children public static void construct_children(RecipeNode node, String[] words) { From 2f05b41eb22f303bd0e242fdaeb4eb555ecbaf4c Mon Sep 17 00:00:00 2001 From: Libkyy Date: Thu, 2 Jun 2022 20:33:39 +0200 Subject: [PATCH 6/9] fixing stuff :D --- .idea/misc.xml | 2 +- src/RecipeInstructions.java | 24 +++++------------------- 2 files changed, 6 insertions(+), 20 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index f3f4fc6..07115cd 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/src/RecipeInstructions.java b/src/RecipeInstructions.java index ec89917..78230ad 100644 --- a/src/RecipeInstructions.java +++ b/src/RecipeInstructions.java @@ -12,16 +12,17 @@ public class RecipeInstructions ArrayList ingredients = new ArrayList<>(); RecipeTree fullInstructions = new RecipeTree(); + Scanner userInput = new Scanner(System.in); do { System.out.println("Enter instruction: "); - Scanner userInput = new Scanner(System.in); userInstruction = userInput.nextLine(); - RecipeCreation(userInstruction); + RecipeCreation(userInstruction,fullInstructions); + fullInstructions.printTree(); - } while (userInstruction.equalsIgnoreCase("done")); + } while(!userInstruction.equalsIgnoreCase("done")); } //Magical Regex @@ -32,24 +33,11 @@ public class RecipeInstructions } // This creates an action + children - public static void RecipeCreation(String instructionIn) + public static void RecipeCreation(String instructionIn, RecipeTree fullInstructions) { - //New tree who dis - RecipeTree fullInstructions = new RecipeTree(); - //Stinky Scanner please remove or something idk - //Maybe make the method take a string in or somethiong :D - // Scanner input = new Scanner(System.in); <-- Commented remove for testing - String userInput; //Need to not hardcode verbs maybe a global variable for it? etc etc String[] verbs = {"add", "mix", "stir", "wait", "bake", "heat", "sift", "boil", "melt", "fry", "cool", "remove", "eat", "cut"}; - //init this shit - int currentNumber = 0; - String currentIngredient = null; - //Useless sout lol -// userInput = input.nextLine(); - //this was simulating user input for the tests below - // userInput = "mix 3 eggs and 2 milk"; <-- Commented remove for testing //this is where it gets juicy //FIRST WE FIND A VERB FOR THE ACTION for (String verb : verbs) @@ -68,7 +56,6 @@ public class RecipeInstructions //we add the thing to the tree (this also needs to be checked for WHERE it gets added) fullInstructions.addNode((RecipeNode) null, newAction); } - fullInstructions.printTree(); } } @@ -105,7 +92,6 @@ public class RecipeInstructions @Test void testRecipeCreation() { - RecipeCreation("disNotRealOnlyToAvoidErrorTrustDuud"); } @Test void testconstruct_children() From 5e0ad7d9ffd12ed0aa0994fa7635beed6e842412 Mon Sep 17 00:00:00 2001 From: Supermjork Date: Thu, 2 Jun 2022 21:09:59 +0200 Subject: [PATCH 7/9] Failed action adder --- .idea/misc.xml | 2 +- src/RecipeInstructions.java | 2 +- src/RecipeTree.java | 14 ++++++++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index 07115cd..f3f4fc6 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/src/RecipeInstructions.java b/src/RecipeInstructions.java index 78230ad..f4f09eb 100644 --- a/src/RecipeInstructions.java +++ b/src/RecipeInstructions.java @@ -54,7 +54,7 @@ public class RecipeInstructions String[] words = split[1].split(" "); construct_children(newAction, words); //we add the thing to the tree (this also needs to be checked for WHERE it gets added) - fullInstructions.addNode((RecipeNode) null, newAction); + fullInstructions.actionAdd(newAction); } } diff --git a/src/RecipeTree.java b/src/RecipeTree.java index e961aa9..58546e5 100644 --- a/src/RecipeTree.java +++ b/src/RecipeTree.java @@ -130,5 +130,19 @@ public class RecipeTree } } + public void actionAdd(RecipeNode actionNchild) { + if(root == null) { + root = actionNchild; + } else { + for(RecipeNode node : root.children) { + if(node.getPortion() != 0 || !actionNchild.getIngredient().equals(node.getIngredient())) { + actionAdd(actionNchild); + } else if(node.getPortion() == 0 && actionNchild.getIngredient().equals(node.getIngredient())) { + actionNchild.parent = node.parent; + node.parent = actionNchild; + } + } + } + } } From bbb44075c0031a23efeb1c6c8fa43448c878c47a Mon Sep 17 00:00:00 2001 From: Libkyy Date: Thu, 2 Jun 2022 22:12:26 +0200 Subject: [PATCH 8/9] pog champ pog champs --- .idea/misc.xml | 2 +- src/RecipeTree.java | 36 +++++++++++++++++++++++++++--------- 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index f3f4fc6..07115cd 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/src/RecipeTree.java b/src/RecipeTree.java index 58546e5..f9037bd 100644 --- a/src/RecipeTree.java +++ b/src/RecipeTree.java @@ -130,19 +130,37 @@ public class RecipeTree } } - public void actionAdd(RecipeNode actionNchild) { +// public void actionAdd(RecipeNode root,RecipeNode actionNchild) { +// if(root == null) { +// this.root = actionNchild; +// } else { +// for(RecipeNode node : root.getChildren()) { +// if(node.getPortion() != 0 || !actionNchild.getIngredient().equals(node.getIngredient())) { +// actionAdd(node,actionNchild); +// } else if(node.getPortion() == 0 && actionNchild.getIngredient().equals(node.getIngredient())) { +// addNode(node, actionNchild); +// } +// } +// } +// } + public void actionAdd(RecipeNode root,RecipeNode actionNchild) { if(root == null) { - root = actionNchild; + this.root = actionNchild; } else { - for(RecipeNode node : root.children) { - if(node.getPortion() != 0 || !actionNchild.getIngredient().equals(node.getIngredient())) { - actionAdd(actionNchild); - } else if(node.getPortion() == 0 && actionNchild.getIngredient().equals(node.getIngredient())) { - actionNchild.parent = node.parent; - node.parent = actionNchild; + for(RecipeNode node : root.getChildren()) { + if(node.getPortion() == 0 && node.getChildren() != null) + actionAdd(node,actionNchild); + else + addNode(node,actionNchild); + + } } } - } + public void actionAdd(RecipeNode actionNchild) + { + actionAdd(root, actionNchild); + } + } From 48420640bcc1db131561db2ced165cde865c16b9 Mon Sep 17 00:00:00 2001 From: Supermjork Date: Thu, 2 Jun 2022 22:28:46 +0200 Subject: [PATCH 9/9] Presumed final commit of this god forsaken project. --- .idea/misc.xml | 2 +- src/RecipeInstructions.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index 07115cd..f3f4fc6 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/src/RecipeInstructions.java b/src/RecipeInstructions.java index f4f09eb..79ebb35 100644 --- a/src/RecipeInstructions.java +++ b/src/RecipeInstructions.java @@ -21,6 +21,7 @@ public class RecipeInstructions RecipeCreation(userInstruction,fullInstructions); fullInstructions.printTree(); + System.out.println(fullInstructions.sortTopology()); } while(!userInstruction.equalsIgnoreCase("done")); }