Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/domblack/advent-of-code-2023
My attempt of the Advent Of Code for 2023 in Go
https://github.com/domblack/advent-of-code-2023
advent-of-code advent-of-code-2023 advent-of-code-2023-go adventofcode adventofcode2023 aoc aoc-2023 aoc-2023-in-go aoc-in-go go golang
Last synced: 5 days ago
JSON representation
My attempt of the Advent Of Code for 2023 in Go
- Host: GitHub
- URL: https://github.com/domblack/advent-of-code-2023
- Owner: DomBlack
- License: mit
- Created: 2023-12-02T15:55:42.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-06-26T19:37:22.000Z (4 months ago)
- Last Synced: 2024-10-11T08:15:24.575Z (28 days ago)
- Topics: advent-of-code, advent-of-code-2023, advent-of-code-2023-go, adventofcode, adventofcode2023, aoc, aoc-2023, aoc-2023-in-go, aoc-in-go, go, golang
- Language: Go
- Homepage: https://adventofcode.com/2023
- Size: 13.5 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Advent of Code λ2023
This repository contains my solutions for the [Advent of Code 2023](https://adventofcode.com/2023), written in [Go](https://goland.org).
## Project Structure
The project is structured in a way that each day of the Advent of Code challenge has its own package under the `internal`
directory. For example, the solution for Day 10 can be found in [`internal/day10/day10.go`](internal/day10/day10.go).The [`cmd/aoc2023`](cmd/aoc2023) package is the main entry point of the application.
It combines all the days into a single application.All my personalised inputs are stored in the [`inputs`](inputs) directory, and each day has a corresponding text file
in there. I've also included expected outputs for each day in the day's package using a call to `WithExpectedAnswers`,
this is to allow for regression testing after refactoring.The `pkg` directory contains various packages that are used across the solutions.
- [`pkg/runner`](pkg/runner) contains a generic runner for registering, running and testing the solutions for each day.
Every day uses this without fail. It will be at the top of each day's go file, and pretty much the only thing in the days
test file.
- [`pkg/stream`](pkg/stream) contains various stream functors and sinks used across the solutions.
- [`pkg/alogrithms`](pkg/algorithms) contains various common algorithms used across the solutions.
- [`pkg/datastructures`](pkg/datastructures) contains various common data structures used across the solutions.## Running the Code
To run the code, you need to have Go installed on your system. You can download it from the [official Go website](https://golang.org/dl/).
Once you have Go installed, you can run the code for all days by navigating to the root directory of the project and running:
```bash
go run ./cmd/aoc2023
```If you want to run the code for a specific day only, you can do so by providing the `--day` flag followed by the day number. For example, to run the code for Day 10, you would do:
```bash
go run ./cmd/aoc2023 --day 10
```## Contributing
While this is primarily a personal project, contributions are welcome. If you see an issue or have a suggestion for improvement, feel free to open an issue or submit a pull request.
## License
This project is licensed under the MIT License. See the [`LICENSE`](LICENSE) file for more details.