Code Monkey home page Code Monkey logo

aoc-ts's Introduction

Advent of Code template

The repository is an early version of a simple way to participate in Advent of Code in a TypeScript environment. In this iteration, it'll also serve as my own puzzle solving repo. Let's go!

Usage

To get started, clone the repository and run npm ci in the root.

Any year folder in /src (like 2023, 2022 etc), are puzzle content and not part of the template.

Get your session token

First thing you need is your session token from adventofcode.com. This is used to fetch your personalized input data from each puzzle. It can be found under the network tab in your dev tools. Check this post for assistanse.

Once you have your token, copy .env.sample, rename it to .env, and include your token in the AOC_SESSION spot. In your .env file you can also adjust what year of Advent of Code you want to work with. Defaults to 2023.

Generate a puzzle

Use npm run generate to generate a folder for a puzzle, and fetch the input data. The script expects an argument for the day you want to work with, for example npm run generate day=5 will generate the folder and fetch the input data for day 5.

The generated folder includes the following files:

  • input.txt: The raw input data for the puzzle.
  • index.ts: The TS file to work with, lightly prepared for reading the input file.
  • 1.ts and 2.ts: The TS files for each part of the puzzle, lightly prepared for consuming the prepared input file.

From there, you're on your own. Navigate in to the day folder you want to work in, and run the script with npx nodemon index.ts. Good luck with the puzzles!

aoc-ts's People

Contributors

braedenkilburn avatar

Stargazers

 avatar

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.