add template
This commit is contained in:
0
2022/rs/15.input
Normal file
0
2022/rs/15.input
Normal file
30
2022/rs/src/day_15.rs
Normal file
30
2022/rs/src/day_15.rs
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
|
||||||
|
pub const CHALLENGE_INPUT: &str = include_str!("../15.input");
|
||||||
|
pub const EXAMPLE_INPUT: &str = "498,4 -> 498,6 -> 496,6\n503,4 -> 502,4 -> 502,9 -> 494,9";
|
||||||
|
|
||||||
|
|
||||||
|
pub fn part_1(input: &str) -> i32 {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn part_2(input: &str) -> i32 {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod test {
|
||||||
|
use crate::day_15;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn part1_test() {
|
||||||
|
assert_eq!(day_15::part_1(day_15::EXAMPLE_INPUT), 24);
|
||||||
|
assert_eq!(day_15::part_1(day_15::CHALLENGE_INPUT), 757);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn part2_test() {
|
||||||
|
assert_eq!(day_15::part_2(day_15::EXAMPLE_INPUT), 93);
|
||||||
|
assert_eq!(day_15::part_2(day_15::CHALLENGE_INPUT), 24943);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -2,8 +2,9 @@
|
|||||||
#![allow(unused_variables)]
|
#![allow(unused_variables)]
|
||||||
|
|
||||||
mod day_14;
|
mod day_14;
|
||||||
|
mod day_15;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
println!("Part 1: {}", day_14::part_1(day_14::CHALLENGE_INPUT));
|
println!("Part 1: {}", day_15::part_1(day_15::CHALLENGE_INPUT));
|
||||||
println!("Part 2: {}", day_14::part_2(day_14::CHALLENGE_INPUT));
|
println!("Part 2: {}", day_15::part_2(day_15::CHALLENGE_INPUT));
|
||||||
}
|
}
|
||||||
|
|||||||
26
2022/rs/template.rs
Normal file
26
2022/rs/template.rs
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
pub const CHALLENGE_INPUT: &str = include_str!("../**.input");
|
||||||
|
pub const EXAMPLE_INPUT: &str = "";
|
||||||
|
|
||||||
|
pub fn part_1(input: &str) -> i32 {
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn part_2(input: &str) -> i32 {
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod test {
|
||||||
|
use crate::day;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn part1_test() {
|
||||||
|
assert_eq!(day::part_1(day::EXAMPLE_INPUT), 1);
|
||||||
|
assert_eq!(day::part_1(day::CHALLENGE_INPUT), 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn part2_test() {
|
||||||
|
assert_eq!(day::part_2(day::EXAMPLE_INPUT), 1);
|
||||||
|
assert_eq!(day::part_2(day::CHALLENGE_INPUT), 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user