Giter VIP home page Giter VIP logo

aoc2023-ts's Introduction

๐ŸŽ„ AdventOfCode-typescript-template ๐ŸŽ„

This is a TypeScript boilerplate for Advent of Code.

built with โค๏ธ and:

๐Ÿ‘ทโ€โ™‚๏ธ Project structure

the project has the following structure:

src
- days: contains the solutions for the puzzles
- scripts: utility scripts for development lifecycle
- types: types and interfaces
- utils: utility scripts used for development and problem solving (i.e read an input file)

๐Ÿš€ Getting started

This readme assumes you are using pnpm as package manager, but any other package manager will do.

The runtime used for this project is bun bun, check the docs for installing it.

install all required dependencies with pnpm i

๐ŸŽ„ Adding a new puzzle

when the new AoC puzzle is available run pnpm init-day {day}

replace {day} with the number of the advent day, i.e. pnpm init-day 2.

This command will create a new directory in the days folder with the following content

  • Puzzle.ts: the boilerplate module with the placeholder methods for solving both daily puzzles
  • index.txt: the input file where to add the puzzle input

The structure of the boilerplate module is the following:

const first = (input: string) => {
  console.log(input);
  return 'solution 1';
};

const expectedFirstSolution = 'solution 1';

const second = (input: string) => {
  console.log(input);
  return 'solution 2';
};

const expectedSecondSolution = 'solution 2';

export { first, expectedFirstSolution, second, expectedSecondSolution };

๐Ÿ”ง Development

When your solution is ready, or when you want to start developing incrementally (watch mode) run pnpm dev {day} where {day} is the day you are working on, i.e. pnpm dev 1 will run the puzzle class for day 1.

๐Ÿงช Testing

You can run test for all puzzles agains their expected output with pnpm t this will test all the solutions in the days folder

๐Ÿ›ซ Contributing

Every contribution is welcome. Just fork this repo and open a MR with your changes, and don't forget to add your name to the contributors section of this README.

๐Ÿ‘จ๐Ÿ‘ฉ Contributors

Francesco Maida

aoc2023-ts's People

Contributors

richardhodsdon avatar balthasar 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.