This is my try on the Advent of code of 2022 challanges with JavaScript!
- Day 1 - Calorie Counting: ⭐⭐
- Day 2 - Rock Paper Scissors: ⭐⭐
- Day 3 - Rucksack Reorganization: ⭐⭐
- Day 4 - Camp Cleanup: ⭐⭐
- Day 5 - Supply Stacks: ⭐⭐
- Day 6 - Tuning Trouble: ⭐⭐
- Day 7 - No Space Left On Device: ⭐⭐
- Day 8 - Treetop Tree House: ⭐⭐
- Day 9 - Rope Bridge: ⭐⭐
- Day 10 - Cathode-Ray Tube: ⭐⭐
- Day 11 - Monkey in the Middle: ⭐⭐
- Day 12 - Hill Climbing Algorithm: ⭐⭐
- Day 13 - Distress Signal: ⭐⭐
- Day 14 - Regolith Reservoir: ⭐⭐
- Day 15 - Beacon Exclusion Zone: ⭐⭐
- ...
- Day 17 - Pyroclastic Flow: ⭐
- Day 18 - Boiling Boulders: ⭐
- ...
- Day 21 - Monkey Math: ⭐
- ...
days: the code for each day will be in the days folder as a.jsfile. My template is also there, so that I can start each day with the same structure.inputs: all my input data for each day is saved the inputs folder as a.txtfile. I also have atest.txtfile, that I use for the example input of each days puzzle.helpers.js: I created some helpers to read the input data an I am pretty sure, i will add some other helping functions if I see that puzzles will need some generic functionality more than once.
I use node.js to run my code. So to run a specific day, you need to use the following command:
node .\days\dayX.js //exchange X with the days numberEach dayX.js file, automatically reads the input for the certain day (dayX.txt). If you want the day to use a specific .txt file, you have to write the name of the file as an argument when running the day in the command line.
The command then will look like this:
node .\days\dayX.js test.txt //exchange X with the days number, exchange test.txt with your filename