Skip to content

M3kH/advent-of-code-2021

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Advent of code 2021

Welcome to my trip in learning a bit of golang while doing the Advent of Code.

Requirements:

  • emacs
  • org-mode
  • golang

You can run the challenges by executing this readme:

./README.org <challenge-id>(eg: 0101)

Day 1: Sonar Sweep

Count the number of times a depth measurement increases from the previous measurement. NB: When looping the first item, there is no previous measurement.

Result 0101

Source

cat ../dataset/01.txt | go run aoc 0101
1400

Part two Count the number of times the sum of measurements in this sliding window increases from the previous sum.

Result 0102

Source

cat ../dataset/01.txt | go run aoc 0102
1429

Day 2: Dive!

Calculate the horizontal position and depth you would have after following the planned course. What do you get if you multiply your final horizontal position by your final depth?

Result 0201

Source

cat ../dataset/02.txt | go run aoc 0201
1580000

Part two Using this new interpretation of the commands, calculate the horizontal position and depth you would have after following the planned course. What do you get if you multiply your final horizontal position by your final depth?

Result 0202

Source

cat ../dataset/02.txt | go run aoc 0202
1251263225

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages