https://github.com/deanlogan/advent-of-code
Advent of code 2023 & 2024, completed in Go
https://github.com/deanlogan/advent-of-code
advent-of-code-2023 go golang
Last synced: over 1 year ago
JSON representation
Advent of code 2023 & 2024, completed in Go
- Host: GitHub
- URL: https://github.com/deanlogan/advent-of-code
- Owner: DeanLogan
- Created: 2024-01-06T10:41:33.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-26T13:40:38.000Z (over 1 year ago)
- Last Synced: 2025-01-23T00:44:50.669Z (over 1 year ago)
- Topics: advent-of-code-2023, go, golang
- Language: Go
- Homepage:
- Size: 13 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Advent Of Code in Go!
Advent of code is a Advent calendar of programming puzzles, this features my solutions to the programming puzzles presented in the Advent of Code, a festive calendar of intriguing challenges. I've implemented these solutions using the Go programming language.
Visit [https://adventofcode.com/](https://adventofcode.com/) to find out more about advent of code
# Repo Structure
- Each day (puzzle) is seperated into its corresponding folder, there is a single go.mod file so to run the code for each day you can simple cd into the root of the advent-of-code folder and enter the following:
```console
go run .{year of challange}/day{number of the day you want to see}
```
An example of this would be `go run .2023/day01` which would run 2023's day 1 challange.
- The libs folder contains functions that are used across various days, e.g. functions for reading .txt files, string manipulation, etc.
- The template folder contains code that generates the template that I use for each day, it will create a folder for the day selected, along with a go file with some template code, a README.md and then a input.txt file which will connect to the corresponding day and year on advent of code and scrape the input data and place it into the input.txt file. To run create a template enter the following into the console:
```console
go run ./template
```
Then you will be prompted with the year and day you want to create the template for.
**NOTE:** Before you run the template file ensure you have set the COOKIE environment variable in a .env file created at the root of the project structure. This is necassary to get the input for puzzle as it differs for each user.
# Advent Of Code in 2023, and how I got started doing this
As I found myself quite busy during december due to some exams/courswork at university I decided not to take part while the challanges were being realeased, but as those exams are finished now (thank god :)), I've finally found the time to delve into the Advent of Code puzzles. Given my limited experience with Go – just a single course under my belt – I saw this as an great opportunity to strengthen my knowledge of Go.