/advent-of-code

🎄 Advent of Code in Go: Efficient and educational solutions to festive coding challenges, showcasing Go's simplicity and power. 🎄

Primary LanguageGo

🎄 Advent of Code Solutions in Go 🎄

Introduction

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.

Repository Structure

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.
  • Additionally, there's a default directory for common functions used across multiple puzzles and a template that i use trough different days.

Running the Solutions

To run any of the solutions, follow these steps:

  1. Ensure you have Go installed on your machine. You can download it from the Go website.
  2. Clone this repository to your local machine.
  3. Navigate to the directory of the day you want to run, for example: cd 1.
  4. Run the solution using go run main.go "path to input.txt".

Why Go?

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!

Contributions

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! 🎄