Giter Site home page Giter Site logo

aoc-2022's Introduction

AOC starting kit

A basic setup to start writing code to solve AOC challenges.

It includes

  • RSpec setup
  • Convention for naming solution classes and where to store helper methods.
  • rake task to generate answers directly from the command line.

Setup

  • Install a recent version of Ruby
  • bundle install
  • rake solve[1,1] to run the solution for AOC 2021 Day 1 part 1.
  • Write your own.

Writing your solutions

  • One file per day, e.g. lib/day_1.rb
  • Name your classes Day1, Day2, etc.
  • Make them inherit from the AOC where you can store any helper methods you will reuse for different challenges.
  • Each Day# class should have an instance method #solve that accepts one argument : the part of the daily challenge
  • Download your inputs into the data folder, e.g. data/day1.txt

Testing your solutions

  • Write your tests in the spec folder, e.g. spec/day_1_spec.rb
  • You can put the samples given by the challenge in spec/fixtures/ to use them in your tests.
  • Run them with bundle exec rspec

Running your solution

If you followed the conventions above, you can run the rake task rake aoc:solve[1,2] to run your solution for the Day1, part 2. (If you're using zsh you will need to escape the brackets rake aoc:solve\[1,2\]).

aoc-2022's People

Contributors

olinott avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.