Git Product home page Git Product logo

advent-of-code-2020's Introduction

Advent of Code Typescript Starter ๐ŸŽ„

Basic template project for lightning fast and bug free Advent of Code puzzle solving!

https://adventofcode.com/2020

Happy Advent!

Install

  1. git clone [email protected]:bpiggin/advent-of-code-typescript-starter.git
  2. cd advent-of-code-typescript-starter && yarn install

Features

๐Ÿ’… Prettier: Auto formatting!

๐Ÿƒ Jest: Instant test feedback!

โš™๏ธ Auto Generated Boilerplate: Script to create new folder with test code and functions for each day!

โœ๏ธ Input Parser: Parse problem inputs easily!

๐Ÿ› Debug Config: Breakpoint through your code with no compile step!

Why?

Writing input parsing and project structure boilerplate every day is annoying. Having instant test feedback is really useful.

Instant test feedback

Run yarn test which will start jest in watch mode. Run in vscode terminal for instant feedback. By default it will run for files that have changed in git. Commit previous days so their tests don't run anymore.

New day boilerplate

You will need to run chmod +x newDay.sh && chmod +x partTwo.sh so you can run the scripts. Then run yarn day {day} e.g. yarn day 2 will create a day2 folder with day2.ts, day2.test.ts and day2.data.ts files with boilerplate code.

yarn part2 {day} will generate day1.part2.ts and day1.part2.test.ts files.

Debugging

The Debug Jest Tests debug config will run your jest tests and let you breakpoint through them.

Convenience methods

log() will log to stdout but without the annoying line numbers from jest. If you want line numbers use console.log().

parseInput function will also try to parse the puzzle input for you but beware! I have no idea what formats the inputs will be in this year...

logAnswer will print your problem answer from the jest tests with ---- to make it super visible.

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.