Skip to content

billikowski/advent-of-code-starter

 
 

Repository files navigation

AdventOfCodeStarter

How it works:

Clone this repo with the command:

git clone https://github.com/ZackDeRose/advent-of-code-starter.git

For each puzzle of the advent of code, this starter gives you:

  • a .ts file for your solution (in src/day-X)
  • a .spec.ts file for testing (also in src/day-X)
  • a <a/b>.test.txt file for your test data-set (in data/day-X)
  • a <a/b>.txt file for you to paste your full dataset (also in data/day-X).

The starting point we've generated will allow you to use the commands provided to pass the appropriate data set when running/testing your solution.

Running Commands

Given you're on the first puzzle of day 1, here are the commands available:

Run Your Code

npx nx day-1-a

This will run your code in a node context against the full data set provided in data/day-1/a.txt

  • the --watch option can be added to add file watching (i.e.: npx nx day-1-a --watch)
  • the --test-data option can be added to run against your test data set found in the provided data/day-1/a-test.txt (i.e.: npx nx day-1-a --test-data);
  • these options can be combined (i.e.: npx nx day-1-a --test-data --watch)

Run Tests

npx nx test-day-1-a

This will run the test you can find in src/day-1/a.spec.ts.

The generated code in this file will already import and run your solution from src/day-1/a.ts against the data found in data/day-1/a-test.txt, but you are welcome to adjust this test code as needed.

  • the --watch option can be used to turn on file-watching for your test.

This workspace has been generated by Nx, a Smart, fast and extensible build system.

Further help

Visit the Nx Documentation to learn more.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 99.7%
  • JavaScript 0.3%