These are my solutions for the 2023 edition of AdventJS. This repository contains everything you need to run my solutions.
The solutions require NodeJS version 19.2.0 to run. In addition you need a couple of packages, these can be installed by running the npm install
command from the root folder of the project.
Each day has its own folder and should contain the following files:
README.md
, this is explains the problem for the daysolution.ts
, this contains a single function which is the default export. The function is used to solve the problem.solution.test.ts
, this contains the tests to verify the solution meets the criteria as stated in the problem.
To run a test for a specific day you can use the following command:
npm test ./src/<day>
For instance to run the tests for day 2:
npm test ./src/02/
It is also possible to run the test for all days using the following command:
npm test
Part of the score comes from having a solution with a low Cognitive Complexity score. While I haven't found anything that can calculate this on the client-side there is a VSCode extension that will give you a reasonable indication of how your solution will be scored. The CodeMetric extension calculates the complexity and gives feedback on how the complexity code was calculated. See the extension for more information.