Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yangdanny97/advent-of-code-2021-rescript
Advent of Code 2021 - implemented in ReScript
https://github.com/yangdanny97/advent-of-code-2021-rescript
advent-of-code advent-of-code-2021 javascript reasonml rescript
Last synced: about 2 months ago
JSON representation
Advent of Code 2021 - implemented in ReScript
- Host: GitHub
- URL: https://github.com/yangdanny97/advent-of-code-2021-rescript
- Owner: yangdanny97
- Archived: true
- Created: 2021-12-03T03:20:05.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2021-12-26T18:11:00.000Z (almost 3 years ago)
- Last Synced: 2024-08-01T19:56:22.993Z (5 months ago)
- Topics: advent-of-code, advent-of-code-2021, javascript, reasonml, rescript
- Language: ReScript
- Homepage:
- Size: 58.6 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# advent-of-code
[Advent of code 2021](https://adventofcode.com/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
```