https://github.com/failedcode/adventofcode-2024-go
https://github.com/failedcode/adventofcode-2024-go
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/failedcode/adventofcode-2024-go
- Owner: FailedCode
- License: unlicense
- Created: 2024-11-22T18:10:31.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-22T20:16:43.000Z (over 1 year ago)
- Last Synced: 2025-01-29T21:34:31.664Z (over 1 year ago)
- Language: Go
- Size: 28.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.