Git Product home page Git Product logo

adventofcode2018's Introduction

Advent of Code solutions for 2018

Requirements

Crystal-lang, at least 0.27.0

Running tests

Most (but not all) solutions have tests, in a spec/ subdirectory in the day's directory. To run the test, cd into the day's dir and run crystal spec.

What's the deal with that weird unless PROGRAM_NAME thing?

Normally, you write your "library" logic in one Crystal file and your executable "wrapper" in another file, and your specs import the library file and test it.

However, that's a lot of overhead for these problems, but I like the idea of being able to TDD my way to solutions given the sample input/outputs, so each of my solutions checks to see if the file is being imported as part of running specs (by looking at the current executable name and matching against a special name Crystal uses for the crystal spec command) and if so, doesn't execute the "main"/"executable" logic.

adventofcode2018's People

Contributors

spencerwi avatar

Stargazers

 avatar Wilson avatar

Watchers

James Cloos avatar  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.