GitXplorerGitXplorer
y

advent-of-code-2021-rescript

public
3 stars
0 forks
0 issues

Commits

List of commits on branch main.
Unverified
c0598aff2f3aaabcbbf8aae7bab1e027dfcb964d

day 22

yyangdanny97 committed 3 years ago
Unverified
c4d2b745e5f351f11d3512dbc0c78a9f8e624fa0

comment

yyangdanny97 committed 3 years ago
Unverified
9fd7104148e61ea5d4eb4ff9bd6e49df1136dbbe

fmt

yyangdanny97 committed 3 years ago
Unverified
0eda0eb9cfc8171f117ed08a5f4b85c95d6c98b0

day 21

yyangdanny97 committed 3 years ago
Unverified
daf79c1b6bbdec294ed00fdaeca81c37a1eceb98

day 19 what a nightmare

yyangdanny97 committed 3 years ago
Unverified
b3761884ed5e5d25c56263b606f0357a63cec883

fmt

yyangdanny97 committed 3 years ago

README

The README file for this repository.

advent-of-code

Advent of code 2021

Some fun/practice with ReScript. The solutions are mostly in a functional style using immutable data structures where feasible, although mutability is leveraged in some places for performance reasons.

The code file for each day also contains the example input provided on the AOC website, and running the file for a particular day will print the answers to part 1 and part 2 in your console. The entry points for each part are functions named part1 and part2.

Inputs are mostly represented as array literals because 1) I'm not interested in parsing the raw input text and 2) literals for large lists compile to something nasty, so using an array literal and calling List.fromArray makes the most sense.

Setup:

npm install

To build:

npm run re:build

To run the code for a particular day (day 1 for example):

node src/day1.bs.js