diff --git a/Day 1/.classpath b/01/.classpath similarity index 100% rename from Day 1/.classpath rename to 01/.classpath diff --git a/Day 1/.project b/01/.project similarity index 100% rename from Day 1/.project rename to 01/.project diff --git a/Day 1/.settings/org.eclipse.jdt.core.prefs b/01/.settings/org.eclipse.jdt.core.prefs similarity index 100% rename from Day 1/.settings/org.eclipse.jdt.core.prefs rename to 01/.settings/org.eclipse.jdt.core.prefs diff --git a/Day 1/input.txt b/01/input.txt similarity index 100% rename from Day 1/input.txt rename to 01/input.txt diff --git a/Day 1/src/main.java b/01/src/main.java similarity index 100% rename from Day 1/src/main.java rename to 01/src/main.java diff --git a/Day 2/.classpath b/02/.classpath similarity index 100% rename from Day 2/.classpath rename to 02/.classpath diff --git a/Day 2/.project b/02/.project similarity index 100% rename from Day 2/.project rename to 02/.project diff --git a/Day 2/.settings/org.eclipse.jdt.core.prefs b/02/.settings/org.eclipse.jdt.core.prefs similarity index 100% rename from Day 2/.settings/org.eclipse.jdt.core.prefs rename to 02/.settings/org.eclipse.jdt.core.prefs diff --git a/Day 2/input.txt b/02/input.txt similarity index 100% rename from Day 2/input.txt rename to 02/input.txt diff --git a/Day 2/src/main.java b/02/src/main.java similarity index 100% rename from Day 2/src/main.java rename to 02/src/main.java diff --git a/Day 3/.classpath b/03/.classpath similarity index 100% rename from Day 3/.classpath rename to 03/.classpath diff --git a/Day 3/.project b/03/.project similarity index 100% rename from Day 3/.project rename to 03/.project diff --git a/Day 3/.settings/org.eclipse.jdt.core.prefs b/03/.settings/org.eclipse.jdt.core.prefs similarity index 100% rename from Day 3/.settings/org.eclipse.jdt.core.prefs rename to 03/.settings/org.eclipse.jdt.core.prefs diff --git a/Day 3/input.txt b/03/input.txt similarity index 100% rename from Day 3/input.txt rename to 03/input.txt diff --git a/Day 3/src/main.java b/03/src/main.java similarity index 100% rename from Day 3/src/main.java rename to 03/src/main.java diff --git a/Day 4/.classpath b/04/.classpath similarity index 100% rename from Day 4/.classpath rename to 04/.classpath diff --git a/Day 4/.project b/04/.project similarity index 100% rename from Day 4/.project rename to 04/.project diff --git a/Day 4/.settings/org.eclipse.jdt.core.prefs b/04/.settings/org.eclipse.jdt.core.prefs similarity index 100% rename from Day 4/.settings/org.eclipse.jdt.core.prefs rename to 04/.settings/org.eclipse.jdt.core.prefs diff --git a/Day 4/input.txt b/04/input.txt similarity index 100% rename from Day 4/input.txt rename to 04/input.txt diff --git a/Day 4/src/main.java b/04/src/main.java similarity index 100% rename from Day 4/src/main.java rename to 04/src/main.java diff --git a/Day 5/.classpath b/05/.classpath similarity index 100% rename from Day 5/.classpath rename to 05/.classpath diff --git a/Day 5/.project b/05/.project similarity index 100% rename from Day 5/.project rename to 05/.project diff --git a/Day 5/.settings/org.eclipse.jdt.core.prefs b/05/.settings/org.eclipse.jdt.core.prefs similarity index 100% rename from Day 5/.settings/org.eclipse.jdt.core.prefs rename to 05/.settings/org.eclipse.jdt.core.prefs diff --git a/Day 5/input.txt b/05/input.txt similarity index 100% rename from Day 5/input.txt rename to 05/input.txt diff --git a/Day 5/src/main.java b/05/src/main.java similarity index 100% rename from Day 5/src/main.java rename to 05/src/main.java diff --git a/Day 6/.classpath b/06/.classpath similarity index 100% rename from Day 6/.classpath rename to 06/.classpath diff --git a/Day 6/.project b/06/.project similarity index 100% rename from Day 6/.project rename to 06/.project diff --git a/Day 6/.settings/org.eclipse.jdt.core.prefs b/06/.settings/org.eclipse.jdt.core.prefs similarity index 100% rename from Day 6/.settings/org.eclipse.jdt.core.prefs rename to 06/.settings/org.eclipse.jdt.core.prefs diff --git a/Day 6/input.txt b/06/input.txt similarity index 100% rename from Day 6/input.txt rename to 06/input.txt diff --git a/Day 6/src/main.java b/06/src/main.java similarity index 100% rename from Day 6/src/main.java rename to 06/src/main.java diff --git a/Day 7/.classpath b/07/.classpath similarity index 100% rename from Day 7/.classpath rename to 07/.classpath diff --git a/Day 7/.project b/07/.project similarity index 100% rename from Day 7/.project rename to 07/.project diff --git a/Day 7/.settings/org.eclipse.jdt.core.prefs b/07/.settings/org.eclipse.jdt.core.prefs similarity index 100% rename from Day 7/.settings/org.eclipse.jdt.core.prefs rename to 07/.settings/org.eclipse.jdt.core.prefs diff --git a/Day 7/input.txt b/07/input.txt similarity index 100% rename from Day 7/input.txt rename to 07/input.txt diff --git a/Day 7/src/Directory.java b/07/src/Directory.java similarity index 100% rename from Day 7/src/Directory.java rename to 07/src/Directory.java diff --git a/Day 7/src/File.java b/07/src/File.java similarity index 100% rename from Day 7/src/File.java rename to 07/src/File.java diff --git a/Day 7/src/main.java b/07/src/main.java similarity index 100% rename from Day 7/src/main.java rename to 07/src/main.java diff --git a/19/Day 19/.vscode/settings.json b/19/Day 19/.vscode/settings.json new file mode 100644 index 0000000..e112a70 --- /dev/null +++ b/19/Day 19/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "java.project.sourcePaths": ["src"], + "java.project.outputPath": "bin", + "java.project.referencedLibraries": [ + "lib/**/*.jar" + ] +} diff --git a/19/Day 19/README.md b/19/Day 19/README.md new file mode 100644 index 0000000..7c03a53 --- /dev/null +++ b/19/Day 19/README.md @@ -0,0 +1,18 @@ +## Getting Started + +Welcome to the VS Code Java world. Here is a guideline to help you get started to write Java code in Visual Studio Code. + +## Folder Structure + +The workspace contains two folders by default, where: + +- `src`: the folder to maintain sources +- `lib`: the folder to maintain dependencies + +Meanwhile, the compiled output files will be generated in the `bin` folder by default. + +> If you want to customize the folder structure, open `.vscode/settings.json` and update the related settings there. + +## Dependency Management + +The `JAVA PROJECTS` view allows you to manage your dependencies. More details can be found [here](https://github.com/microsoft/vscode-java-dependency#manage-dependencies). diff --git a/19/Day 19/src/main.java b/19/Day 19/src/main.java new file mode 100644 index 0000000..30121ff --- /dev/null +++ b/19/Day 19/src/main.java @@ -0,0 +1,27 @@ +import java.io.IOException; +import java.io.RandomAccessFile; + +public class main { + public static void main(String[] args) throws IOException { + RandomAccessFile file = new RandomAccessFile("input.txt", "r"); + String str; + + //Part 1 + System.out.print("Part 1: "); + + while ((str = file.readLine()) != null) { + System.out.println(str); + int blueprintID = Integer.typeOf(str.substring(11,12)); + int costOfOreRobot = str.subString(); + simulateRobotWithBlueprints(); + } + //Part 2 + System.out.print("Part 2: "); + } + + public int simulateRobotWithBlueprints(int costOfOreRobot, int costOfClayRobot, int costOfObsidianRobot, int costOfGeodeRobot, int timeInMinutes) { + int maximumNumberOfOpenedGeodes = 0; + + return maximumNumberOfOpenedGeodes; + } +} diff --git a/19/input.txt b/19/input.txt new file mode 100644 index 0000000..1c73b7c --- /dev/null +++ b/19/input.txt @@ -0,0 +1,30 @@ +Blueprint 1: Each ore robot costs 3 ore. Each clay robot costs 4 ore. Each obsidian robot costs 4 ore and 18 clay. Each geode robot costs 3 ore and 8 obsidian. +Blueprint 2: Each ore robot costs 4 ore. Each clay robot costs 4 ore. Each obsidian robot costs 2 ore and 18 clay. Each geode robot costs 4 ore and 20 obsidian. +Blueprint 3: Each ore robot costs 3 ore. Each clay robot costs 4 ore. Each obsidian robot costs 4 ore and 18 clay. Each geode robot costs 4 ore and 12 obsidian. +Blueprint 4: Each ore robot costs 4 ore. Each clay robot costs 4 ore. Each obsidian robot costs 4 ore and 20 clay. Each geode robot costs 2 ore and 8 obsidian. +Blueprint 5: Each ore robot costs 2 ore. Each clay robot costs 3 ore. Each obsidian robot costs 2 ore and 14 clay. Each geode robot costs 3 ore and 8 obsidian. +Blueprint 6: Each ore robot costs 3 ore. Each clay robot costs 3 ore. Each obsidian robot costs 3 ore and 17 clay. Each geode robot costs 4 ore and 8 obsidian. +Blueprint 7: Each ore robot costs 4 ore. Each clay robot costs 3 ore. Each obsidian robot costs 4 ore and 6 clay. Each geode robot costs 3 ore and 11 obsidian. +Blueprint 8: Each ore robot costs 2 ore. Each clay robot costs 4 ore. Each obsidian robot costs 4 ore and 20 clay. Each geode robot costs 4 ore and 18 obsidian. +Blueprint 9: Each ore robot costs 3 ore. Each clay robot costs 4 ore. Each obsidian robot costs 4 ore and 16 clay. Each geode robot costs 3 ore and 15 obsidian. +Blueprint 10: Each ore robot costs 4 ore. Each clay robot costs 4 ore. Each obsidian robot costs 3 ore and 7 clay. Each geode robot costs 4 ore and 11 obsidian. +Blueprint 11: Each ore robot costs 4 ore. Each clay robot costs 4 ore. Each obsidian robot costs 2 ore and 9 clay. Each geode robot costs 3 ore and 19 obsidian. +Blueprint 12: Each ore robot costs 4 ore. Each clay robot costs 3 ore. Each obsidian robot costs 2 ore and 17 clay. Each geode robot costs 3 ore and 16 obsidian. +Blueprint 13: Each ore robot costs 3 ore. Each clay robot costs 4 ore. Each obsidian robot costs 4 ore and 5 clay. Each geode robot costs 3 ore and 12 obsidian. +Blueprint 14: Each ore robot costs 3 ore. Each clay robot costs 3 ore. Each obsidian robot costs 3 ore and 8 clay. Each geode robot costs 2 ore and 12 obsidian. +Blueprint 15: Each ore robot costs 4 ore. Each clay robot costs 4 ore. Each obsidian robot costs 3 ore and 7 clay. Each geode robot costs 3 ore and 20 obsidian. +Blueprint 16: Each ore robot costs 3 ore. Each clay robot costs 3 ore. Each obsidian robot costs 2 ore and 11 clay. Each geode robot costs 2 ore and 19 obsidian. +Blueprint 17: Each ore robot costs 4 ore. Each clay robot costs 4 ore. Each obsidian robot costs 2 ore and 10 clay. Each geode robot costs 3 ore and 14 obsidian. +Blueprint 18: Each ore robot costs 3 ore. Each clay robot costs 4 ore. Each obsidian robot costs 3 ore and 12 clay. Each geode robot costs 3 ore and 17 obsidian. +Blueprint 19: Each ore robot costs 4 ore. Each clay robot costs 4 ore. Each obsidian robot costs 4 ore and 7 clay. Each geode robot costs 2 ore and 19 obsidian. +Blueprint 20: Each ore robot costs 2 ore. Each clay robot costs 3 ore. Each obsidian robot costs 2 ore and 17 clay. Each geode robot costs 3 ore and 19 obsidian. +Blueprint 21: Each ore robot costs 4 ore. Each clay robot costs 3 ore. Each obsidian robot costs 2 ore and 14 clay. Each geode robot costs 4 ore and 11 obsidian. +Blueprint 22: Each ore robot costs 4 ore. Each clay robot costs 3 ore. Each obsidian robot costs 4 ore and 15 clay. Each geode robot costs 4 ore and 9 obsidian. +Blueprint 23: Each ore robot costs 4 ore. Each clay robot costs 4 ore. Each obsidian robot costs 3 ore and 9 clay. Each geode robot costs 3 ore and 7 obsidian. +Blueprint 24: Each ore robot costs 4 ore. Each clay robot costs 4 ore. Each obsidian robot costs 4 ore and 15 clay. Each geode robot costs 4 ore and 17 obsidian. +Blueprint 25: Each ore robot costs 4 ore. Each clay robot costs 4 ore. Each obsidian robot costs 4 ore and 9 clay. Each geode robot costs 2 ore and 20 obsidian. +Blueprint 26: Each ore robot costs 3 ore. Each clay robot costs 4 ore. Each obsidian robot costs 3 ore and 20 clay. Each geode robot costs 3 ore and 14 obsidian. +Blueprint 27: Each ore robot costs 2 ore. Each clay robot costs 4 ore. Each obsidian robot costs 2 ore and 15 clay. Each geode robot costs 3 ore and 16 obsidian. +Blueprint 28: Each ore robot costs 2 ore. Each clay robot costs 3 ore. Each obsidian robot costs 3 ore and 8 clay. Each geode robot costs 3 ore and 20 obsidian. +Blueprint 29: Each ore robot costs 3 ore. Each clay robot costs 4 ore. Each obsidian robot costs 2 ore and 14 clay. Each geode robot costs 3 ore and 14 obsidian. +Blueprint 30: Each ore robot costs 4 ore. Each clay robot costs 3 ore. Each obsidian robot costs 4 ore and 18 clay. Each geode robot costs 3 ore and 13 obsidian. \ No newline at end of file diff --git a/Day 19/main.java b/19/main.java similarity index 81% rename from Day 19/main.java rename to 19/main.java index a542156..d20006f 100644 --- a/Day 19/main.java +++ b/19/main.java @@ -11,8 +11,9 @@ public class main { while ((str = file.readLine()) != null) { System.out.println(str); - - simulateRobotWithBlueprints() + int blueprintID = Integer.typeOf(str.subString(11,12)); + int costOfOreRobot = str.subString(); + simulateRobotWithBlueprints(); } //Part 2 System.out.print("Part 2: "); diff --git a/Day 19/input.txt b/Day 19/input.txt deleted file mode 100644 index 5f28270..0000000 --- a/Day 19/input.txt +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file