Solutions to Advent of Code 2020 challenges.
Requirements: Node.js 14
Clone this repo and run npm install
.
npm start <day>
This will execute the script with the default input set. Different input files can be placed in the assets/data/
directory and specified as an additional argument:
npm start <day> <filename>
TypeScript files can be executed directly using ts-node if desired:
npx ts-node src/day-<day>/ <path to input file>
Golfed versions of solutions can be executed using the following command:
npm run golf <day>
- First argument must be input file path
- Assume that the input file will have a trailing newline character
- Store in
src/
folder under the appropriate day, namedindex.ts
- Store in
src/
folder under the appropriate day, namedgolfed.cjs
- When there is a choice between a semicolon, comma, or newline character, use a newline character (
\n
) - Imports (using
require
orimport
) are restricted to built-in Node.js modules