Solutions for the Advent of Code
- About
- Getting started
- Installation
- Usage
- Contributing
- Code Style
- Documentation
- Testing
- TODO
- Changelog
Solutions for the Advent of Code
Documentation can be found here.
See LICENSE
in the project root directory for license information.
Clone the project:
git clone git@github.com:dickdavis/advent-of-code.git
Generate a new solution by providing a year and day in YYYYDD format.
bin/new 202201
After generating the solution, drop your input file in the assets/
directory under the appropriate year.
Use the DD.txt
standard naming convention (example: 01.txt
)
The solution file will be generated in the lib/solutions/
directory under the appropriate year.
Modify the #solutions
method to return an array containing your solutions for each part.
Run the solution by providing a year and day in YYYYDD format.
bin/run 202201
To keep a consistent code style, it is recommended to use
rubocop. If you use vim
and
syntastic, you
can use rubocop
as a Ruby checker. To manually run rubocop
, you
can run the following commands:
# Run rubocop for the entire project
bundle exec rubocop
# Run rubocop for a specific file
bundle exec rubocop foo/bar.rb
Comment any code contributions according to the existing conventions within the project. Reference the examples listed below:
Example top-level comment:
##
# = ClassNameGoesHere
# Author:: [Author Information]
# Copyright:: Copyright [Year] [Author Information]
# License:: GNU Public License 3
#
# This is a class that is something and does something.
Example method comment:
##
# This is a method that does something
Documentation should be regenerated prior to merging any branches into master. The latest
documentation auto-sources off the docs/
folder on
the master branch. For more information on RDoc, go
here.
# Run custom rake task to regenerate RDoc documentation
rake rdoc
Tests should be written for all classes and methods. The test suite can be run manually bundle exec rspec
.
- Write specs
- Initial version of project