Skip to content

Advent of Code 2023 solutions written in Go

License

Notifications You must be signed in to change notification settings

wlachs/aoc23

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Advent of Code 2023

A lightweight execution environment for the Advent of Code challenges written in Go.

2023 Results

Day Part 1 Part 2
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
Day 9
Day 10
Day 11
Day 12
Day 13
Day 14
Day 15
Day 16
Day 17
Day 18
Day 19
Day 20
Day 21
Day 22
Day 23
Day 24
Day 25

Get started

In the following section, I'll show you how to set up and run the environment for the challenges.

Prerequisites

Make sure you have Go >= 1.21.4 installed.

Clone the repository

git clone https://github.com/wlchs/aoc23

Test the solutions

Before submitting a solution, you can test the algorithms with the template input. Navigate to the day you want to check and run the following command:

go test

Alternatively, you can also run the command from the project root.

go test ./days/day_xx/

Compile and run

You can compile code and run with the actual input if all the tests pass. For this, first, run this command:

go build .

To run the solution, you need to provide a few extra arguments.

  • the --day flag must be set to specify which day's solution should run
  • the --input flag specifies the path of the file containing the actual input
  • optionally, you can add the --mode flag to run one part of the daily challenge, accepted values are 1 and 2

And now the complete command:

./advent_of_code_go_template --day x --input path_to_input --mode 1
# or
go run . --day x --input path_to_input --mode 1

Contribution

If you'd like to contribute to the project, open an issue or a pull request!