From 09a0fa364d0766eeba8dbd88bf866f8bdc9dda45 Mon Sep 17 00:00:00 2001 From: "matthias@arch" Date: Sun, 4 Dec 2022 01:07:50 +0100 Subject: [PATCH] Added info to readmes --- 1/README.md | 4 ++++ 2/README.md | 3 +++ 3/README.md | 3 +++ README.md | 2 +- 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/1/README.md b/1/README.md index 7017918..31b5175 100644 --- a/1/README.md +++ b/1/README.md @@ -1,6 +1,10 @@ # [Day 1](https://adventofcode.com/2022/day/1) :gift: + Today's language: **awk** + **GNU-coretils** + +- Task 1: We use awk to find the maximum while we iterate through over the file +- Task 2: We use awk again for summing the calories, then sort them and take the top 3 which we again sum up with awk ```shell # Find the Elf carrying the most Calories. How many total Calories is that Elf carrying? awk -f day1-1.awk input.txt diff --git a/2/README.md b/2/README.md index d23594f..dcb8c34 100644 --- a/2/README.md +++ b/2/README.md @@ -1,6 +1,9 @@ # [Day 2](https://adventofcode.com/2022/day/2) :gift::gift: Today's language: **C++** + +We use that chars are just numbers, so we can easily convert them into the respective points by just subtracting `'A'` or `'X'`. +The rest is then just a few `if else`s. ```shell # What would your total score be if everything goes exactly according to your strategy guide? g++ main.cpp -o day2 diff --git a/3/README.md b/3/README.md index 69fc786..9314c95 100644 --- a/3/README.md +++ b/3/README.md @@ -1,6 +1,9 @@ # [Day 3](https://adventofcode.com/2022/day/3) :gift::gift::gift: + Today's language: **C** + +All the characters (the Elf's items) occuring in (half) a line (backpack) are stored as bits in an unsigned long, duplicate characters can then be determined by bitwise and-ing these numbers. ```shell # Find the item type that appears in both compartments of each rucksack. What is the sum of the priorities of those item types? gcc main.c -o day3 diff --git a/README.md b/README.md index 404639c..eba6a32 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,6 @@ This is a repository for my solutions for the [advent of code 2022](https://adve I will try to use as many different languages am not necessarily trying to do it the best or most efficient way, -Also, checkout the repositories of my friends who do stuff in go and Visual Basic: +Also, checkout the repositories of my friends who do stuff in go, Visual Basic and php: - [Daniel](https://git.quintern.xyz/TheShinyMelon/AOC_2022) - [Jonas](https://github.com/JonasBordewick/advent_of_code_2022)