Categorygithub.com/afonsocraposo/advent-of-code-2024
repository
0.0.0-20241226083659-abf69a97c008
Repository: https://github.com/afonsocraposo/advent-of-code-2024.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# README

Advent of Code 2024 šŸŽ„āœØ

     Merry Christmas!
 ------------------------
   \
    \
     \   ,_---~~~~~----._         
  _,,_,*^____      _____``*g*\"*, 
 / __/ /'     ^.  /      \ ^@q   f 
[  @f | @))    |  | @))   l  0 _/  
 \`/   \~____ / __ \_____/    \   
  |           _l__l_           I   
  }          [______]           I  
  ]            | | |            |  
  ]             ~ ~             |  
  |                            |   
   |                           |   

Welcome to Advent of Code 2024! šŸŽ…āœØ This repo features my solutions to the daily programming puzzles, written in Golang, with a clean architecture for festive coding!


Why Go? 🐹

  • Coolness: I like Go and don't get the chance to use it on my day-to-day
  • Speed: No waiting around for Santa's sleigh.
  • Simplicity: Go keeps the solutions straightforward and delightful.
  • Concurrency: Perfect for parallelizing Santa's busy workshop tasks.

Repo Structure šŸ“‚

Here's how the magic is organized:

.
ā”œā”€ā”€ LICENSE               # Licensing information
ā”œā”€ā”€ cmd
│   └── main.go           # Entry point for running solutions
ā”œā”€ā”€ go.mod                # Go module configuration
ā”œā”€ā”€ internal
│   ā”œā”€ā”€ day1
│   │   └── day1.go       # Solution logic for Day 1
│   ā”œā”€ā”€ day2
│   │   └── day2.go       # Solution logic for Day 2
│   └── utils       # Some utils to help
│       ā”œā”€ā”€ filereader
│       │   └── filereader.go  # File parsing utilities
│       ā”œā”€ā”€ math
│       │   └── math.go        # Math helpers
│       └── matrix
│           └── matrix.go      # Matrix manipulation helpers
└── puzzles                # Puzzle input files (ignored in Git)
    └── day2
        ā”œā”€ā”€ example1.txt
        └── input1.txt

Running a Solution šŸƒ

To solve the puzzles for a specific day, run the following command:

go run cmd/main.go <day-number>

Example

go run cmd/main.go 2

Output

Advent of Code 2024
DAY 2
Part 1:
The solution is: 218
Part 2:
The solution is: 290

Adding New Days šŸ—“ļø

  1. Create a new directory under internal for the day:

    mkdir -p internal/day3
    
  2. Write your solution in internal/day3/day3.go.

  3. Update cmd/main.go to include a case for the new day.