|
| 1 | +# Advent of Code Helper Tool |
| 2 | + |
| 3 | +This repository provides a framework and helper tools to streamline the process of solving [Advent of Code](https://adventofcode.com/) challenges. It includes utilities for building and running Go plugins, managing input files, and running tests. |
| 4 | + |
| 5 | +## Structure |
| 6 | + |
| 7 | +- `internal/processor.go`: Contains the `PluginProcessor` struct and methods for building plugins, calling functions within those plugins, running tests, and getting input data. |
| 8 | +- `internal/input.go`: Contains the `Args` struct and functions for processing command-line arguments and determining file paths. |
| 9 | +- `runner.go`: The main entry point that ties everything together by processing arguments, building the plugin, getting input, running tests, and calling the solution function. |
| 10 | + |
| 11 | +## Usage |
| 12 | + |
| 13 | +1. **Process Arguments**: The tool processes command-line arguments to determine the year, day, part, and input type (sample or input) of the challenge. |
| 14 | +2. **Build Plugin**: It builds the Go plugin for the specified challenge part. |
| 15 | +3. **Get Input**: Reads the input file for the challenge. |
| 16 | +4. **Run Tests**: Executes tests for the specified challenge. |
| 17 | +5. **Call Function**: Calls the solution function from the built plugin and prints the output. |
| 18 | + |
| 19 | +## Example |
| 20 | + |
| 21 | +To run the tool, use the following command: |
| 22 | + |
| 23 | +```sh |
| 24 | +go run runner.go -year=2023 -day=1 -part=1 -input=sample |
| 25 | +``` |
| 26 | + |
| 27 | +This command will: |
| 28 | +- Process the arguments for year 2023, day 1, part 1, and use the sample input. |
| 29 | +- Build the plugin for the specified challenge. |
| 30 | +- Read the sample input file. |
| 31 | +- Run tests for the specified challenge. |
| 32 | +- Call the solution function and print the output. |
| 33 | + |
| 34 | +## Contributing |
| 35 | + |
| 36 | +Feel free to open issues or submit pull requests if you have any improvements or bug fixes. |
| 37 | + |
| 38 | +## License |
| 39 | + |
| 40 | +This project is licensed under the MIT License. |
0 commit comments