Code Monkey home page Code Monkey logo

advent_of_code_ex's Introduction

Advent Of Code Elixir

Repo for doin' the puzzles with Elixir. Because Elixir is fun!

Puzzle Code Generation

You can generate scaffolding for a day's solution by running mix day $puzzle_number $year (e.g. mix day 12 2020).

This will create a module for that day's puzzle and an accompanying test module. You'd run those like mix test test/aoc_2021/day01_test.exs. The basic idea is that you implement each part in the appropriately named part_1 and part_2 functions in that day's module. These are called with the puzzle's input in the autogenerated tests.

Provide a valid session token in the root of the repo, in the .session_token file, to automatically download the puzzle input file!

Tests

Run all the tests with mix test.

You can add a tag above a long-running test so that it doesn't get run by default like so: @tag slow: true

Run all the tests, including ones that take a long time, with mix test --include slow. Currently this takes about 5 minutes.

Also included is a mix task which provides a convenient shortcut for running the tests for a particular day's puzzle. You can run it like this: mix test.aoc $day $year (e.g. mix test.aoc 10 2021). You can also run mix test.aoc.watch to start mix test.watch for the given day and year.

Benchmarks

Benchmarks using benchee exist in the test dirs for some days. You run those like mix run test/aoc_2015/day05/day05_benchmarks.exs. Benchmarking is cool!

CI

A simple Github action is included, which runs the full test suite on each pushed commit.

advent_of_code_ex's People

Contributors

epiccoleman 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.