An open API service indexing awesome lists of open source software.

https://github.com/failedcode/adventofcode-2024-go


https://github.com/failedcode/adventofcode-2024-go

Last synced: about 1 year ago
JSON representation

Awesome Lists containing this project

README

          

# Advent of Code 2024
https://adventofcode.com/2024

Solutions in [GO](https://go.dev/learn/)

## How to run

* Run the current day: `go run .`
* Run a specific day: `go run . --day=` e.g. `go run . --day=6`
* Run a specific part: `go run . --part=<1,2>` e.g. `go run . --day=2 --part=2`
* Run a different input: `go run . --source=` e.g. `go run . --day=2 --part=2 --source=example`

## GO learnings

* There are no default values for function parameters
* string to int conversion requieres explicit `strconv.Atoi`
* `math.Abs` is only implemented for floats
* The go compiler has no option to cool it with unused variables. You need to comment out all the code defining the variable, then comment out all the imports... or you define `func UNUSED(x ...interface{}) {}` and hand all variables you currently don't need to this do-nothing function. Great design, guys.