Coder Social home page Coder Social logo

advent-of-code-2023's Introduction

Advent of Code with Bun

A template repository for solving Advent of Code and experimenting with Bun runtime.

Getting started

  1. Generate your repository using this template.
  2. Make sure you have installed Bun.
  3. Install dependencies:
bun install
  1. Create .env file based on .env.example.
  2. (Optional) Set your session token with environment variables to automatically fetch your input. You can obtain the session token from the AoC session cookie.

Running the Code

To run any solution you have to run the solve script. It will create all directories and files for a day, and also it can fetch your input file. Besides that, it watches all the changes you make and shows a result in a terminal.

Example usage

To run a solution for the first day:

bun solve 1

To run tests in watch mode:

bun test --watch 

Structure

For each day a directory in src is created with the following structure:

๐Ÿ“‚ 01
โ”œโ”€โ”€ ๐Ÿ“œ 01.ts
โ”œโ”€โ”€ ๐Ÿ“œ 01.test.ts
โ”œโ”€โ”€ ๐Ÿ“œ example.txt
โ””โ”€โ”€ ๐Ÿ“œ input.txt

Closing words

Happy coding! ๐ŸŽ„โœจ

advent-of-code-2023's People

Contributors

mikerudge avatar

Watchers

 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.