Crates.io | esb_fireplace |
lib.rs | esb_fireplace |
version | 0.3.0 |
source | src |
created_at | 2024-04-15 01:14:26.898851 |
updated_at | 2024-08-18 19:59:42.605047 |
description | The FIREPLACEv1.0 allows the use of the `esb` tooling for solving Advent of Code problems. |
homepage | https://github.com/luxedo/esb_fireplace-rust |
repository | https://github.com/luxedo/esb_fireplace-rust |
max_upload_size | |
id | 1208699 |
size | 46,490 |
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.
The package can be installed by adding esb_fireplace
to your list of dependencies in Cargo.toml
:
[dependencies]
esb_fireplace = { version = "0.2.0" }
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/.
We want to acknowledge and thank the following contributors for their efforts in making this project better:
Thank you all for your valuable contributions!
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/.