Welcome to my repository of solutions for the Advent of Code challenges, implemented in Go! Advent of Code is an annual event where programmers tackle a series of Christmas-themed puzzles released daily from December 1st to December 25th. These puzzles range in complexity and cover a wide array of topics, making them a fantastic way to improve coding skills and problem-solving abilities.
I chose to use Go (Golang) for these challenges. Go, with its simplicity, efficiency, and strong support for concurrency, has been an excellent choice for these varied and often computationally intensive puzzles. My goal in choosing Go was not just to solve the puzzles, but also to deepen my understanding of the language and its capabilities.
This repository is organized as follows:
- Each day's challenge is in a separate directory, named
day1
,day2
, etc. - Inside each day's directory, you'll find:
- A
main.go
file containing the solution.
- A
- Additionally, there's a
default
directory for common functions used across multiple puzzles and a template that i use trough different days.
To run any of the solutions, follow these steps:
- Ensure you have Go installed on your machine. You can download it from the Go website.
- Clone this repository to your local machine.
- Navigate to the directory of the day you want to run, for example:
cd 1
. - Run the solution using
go run main.go "path to input.txt"
.
I chose Go for several reasons:
- Performance: Go's performance is close to that of C/C++, making it suitable for computationally heavy tasks.
- Simplicity: Go's syntax is clean and straightforward, which helps in focusing on the problem-solving aspect.
- Concurrency: Some puzzles benefit from parallel processing, and Go's goroutines make concurrency easy and efficient.
- Learning: I wanted to strengthen my Go skills, and what better way than through hands-on problem-solving!
Feel free to explore, use, or contribute to these solutions! If you have any improvements or alternative solutions, I would love to see them. Please create a pull request or open an issue.
π Happy Coding and Happy Holidays! π