Skip to content

FailedCode/adventofcode-2024-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Advent of Code 2024

https://adventofcode.com/2024

Solutions in GO

How to run

  • Run the current day: go run .
  • Run a specific day: go run . --day=<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=<name> 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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages