advent_of_code_rs_wasm
v2019.12.45
Published
Solutions to Advent of Code 2019 written in Rust
Downloads
17
Readme
advent_of_code_rs_wasm
Solutions to Advent of Code 2019.
The solutions are implemented in Rust which is compiled to WebAssembly.
Usage as a library
Add dependency:
npm add advent_of_code_rs_wasm
The advent_of_code_rs_wasm
package exports a single solve
function with the following signature:
function solve(day, part, input)
Examples:
const solve = require('advent_of_code_rs_wasm').solve;
assert.equal(solve(1, 1, '14'), '2');
assert.equal(solve(3, 2, "R8,U5,L5,D3\nU7,R6,D4,L4"), '30');
Usage as a command line tool
Install:
$ npm install -g advent_of_code_rs_wasm
# [..]
$ echo 14 | advent-of-code-wasm 1 1
2