Coder Social home page Coder Social logo

advent-of-code-2023-js's Introduction

Advent of Code 2023 - JS Edition

Getting started

Make sure you have node version 20+ installed. (I recommend using asdf to manage your node versions if you need to maintain an older version of node).

To write the solutions for the puzzles use the node test runner:

# runs the tests for day 1 and watches for changes. Change the day number to run the tests for a different day.
node --test --watch --test-name-pattern="day 1"

The tests are written in ./src/test/day-<day>.test.mjs. The solutions are written in ./src/day-<day>/part1.mjs and ./src/day-<day>/part2.mjs. Once you are happy with your solution you can run the puzzle input through it:

# finds the solution for day 1
node src/day-01/main.mjs

src/day-01/main.mjs is a wrapper around your solution that reads the puzzle input from src/day-01/input.txt and prints the solution to the console.

To work on any other day just duplicate the src/day-01 folder and rename it to the day you want to work on, you will also need to duplicate the test file and provide the correct input under input.txt.

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.