Giter VIP home page Giter VIP logo

advent-of-code-2019's Introduction

File Structure

For a given day n, create a folder src/days/<n> with the following files:

  • input.txt containing your user-specific puzzle input
  • parse.ts which has a default export of the type (input: string) => T where T is any type which makes the input easier to work with e.g. number[]
  • a.ts which has a default export of the type (input: T) => string | number where T is the type returned by the parse function and the return value is the result for the first puzzle of the day
  • b.ts which is the same as b.ts but for the second puzzle of the day

The parse.ts file is optional. If omitted, the functions exported by a.ts and b.ts will be passed the original input as a string.

You may create any other helper files in the day's folder as necessary, including *.test.ts files.

Commands

To run tests, use yarn test.

To run a particular puzzle, use yarn solve [<n>[<a|b>]] e.g. yarn solve 1a. If arguments are omitted, the latest available will be used based on what folders/files exist. The solution will be printed to the console and copied to the clipboard.

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.