#advent-of-code #aoc #cli #esb #elfscriptbrigade

esb_fireplace

The FIREPLACEv1.0 allows the use of the esb tooling for solving Advent of Code problems

3 releases (breaking)

0.3.0 Aug 18, 2024
0.2.0 May 5, 2024
0.1.0 Apr 15, 2024

#1093 in Command line utilities

Download history 90/week @ 2024-08-13 25/week @ 2024-08-20 7/week @ 2024-09-10 7/week @ 2024-09-17 4/week @ 2024-09-24 4/week @ 2024-10-01

138 downloads per month

GPL-3.0-or-later

17KB
202 lines

EsbFireplace - Rust

The FIREPLACEv1.0 protocol allows the use of the esb tooling for solving Advent of Code problems. This is an implementation of FIREPLACEv1.0 for rust.

Check esb for more information.

Installation

The package can be installed by adding esb_fireplace to your list of dependencies in Cargo.toml:

[dependencies]
esb_fireplace = { version = "0.2.0" }

Usage

Create a function named start in your solution file and add EsbFireplace.v1_run to it.

use esb_fireplace::{FireplaceError, FireplaceResult};

use std::fmt::Display;

fn solve_pt1(input_data: &str, _args: Vec<String>) -> FireplaceResult<impl Display> {
    Ok(25)
}

fn solve_pt2(input_data: &str, _args: Vec<String>) -> FireplaceResult<impl Display> {
    Ok("December")
}

fn main() -> Result<(), FireplaceError> {
    // 🎅🎄❄️☃️🎁🦌
    // Bright christmas lights HERE
    esb_fireplace::v1_run(solve_pt1, solve_pt2)
}

Running can be done with cargo, but this library is meant to be used with esb.

# You can do this...
cargo run -- --part 1 < input_data.txt

# But instead do this:
esb run --year 2023 --day 1 --lang rust --part 1

The docs can be found at https://docs.rs/esb_fireplace/.

Contributors

We want to acknowledge and thank the following contributors for their efforts in making this project better:

Thank you all for your valuable contributions!

License

ESB - Script your way to rescue Christmas as part of the ElfScript Brigade team. Copyright (C) 2024 Luiz Eduardo Amaral luizamaral306@gmail.com

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Dependencies

~1.1–1.7MB
~31K SLoC