y2024d21p1 very hard
This commit is contained in:
parent
911a60ab6c
commit
466d79e81a
@ -396,8 +396,6 @@ impl From<&str> for Keypad {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use rayon::result;
|
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
const INPUT_1: &str = "029A";
|
const INPUT_1: &str = "029A";
|
||||||
@ -406,12 +404,12 @@ mod tests {
|
|||||||
const INPUT_4: &str = "456A";
|
const INPUT_4: &str = "456A";
|
||||||
const INPUT_5: &str = "379A";
|
const INPUT_5: &str = "379A";
|
||||||
|
|
||||||
//const INPUT_1_BACK: &str =
|
const INPUT_1_BACK: &str =
|
||||||
// "<vA<AA>>^AvAA<^A>A<v<A>>^AvA^A<vA>^A<v<A>^A>AAvA^A<v<A>A>^AAAvA<^A>A";
|
"<vA<AA>>^AvAA<^A>A<v<A>>^AvA^A<vA>^A<v<A>^A>AAvA^A<v<A>A>^AAAvA<^A>A";
|
||||||
//const INPUT_2_BACK: &str = "<v<A>>^AAAvA^A<vA<AA>>^AvAA<^A>A<v<A>A>^AAAvA<^A>A<vA>^A<A>A";
|
const INPUT_2_BACK: &str = "<v<A>>^AAAvA^A<vA<AA>>^AvAA<^A>A<v<A>A>^AAAvA<^A>A<vA>^A<A>A";
|
||||||
//const INPUT_3_BACK: &str =
|
const INPUT_3_BACK: &str =
|
||||||
// "<v<A>>^A<vA<A>>^AAvAA<^A>A<v<A>>^AAvA^A<vA>^AA<A>A<v<A>A>^AAAvA<^A>A";
|
"<v<A>>^A<vA<A>>^AAvAA<^A>A<v<A>>^AAvA^A<vA>^AA<A>A<v<A>A>^AAAvA<^A>A";
|
||||||
//const INPUT_4_BACK: &str = "<v<A>>^AA<vA<A>>^AAvAA<^A>A<vA>^A<A>A<vA>^A<A>A<v<A>A>^AAvA<^A>A";
|
const INPUT_4_BACK: &str = "<v<A>>^AA<vA<A>>^AAvAA<^A>A<vA>^A<A>A<vA>^A<A>A<v<A>A>^AAvA<^A>A";
|
||||||
const INPUT_5_BACK: &str = "<v<A>>^AvA^A<vA<AA>>^AAvA<^A>AAvA^A<vA>^AA<A>A<v<A>A>^AAAvA<^A>A";
|
const INPUT_5_BACK: &str = "<v<A>>^AvA^A<vA<AA>>^AAvA<^A>AAvA^A<vA>^AA<A>A<v<A>A>^AAAvA<^A>A";
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@ -459,37 +457,45 @@ mod tests {
|
|||||||
assert_eq!(keypad_1.sequence, "<Av<AA>>^A");
|
assert_eq!(keypad_1.sequence, "<Av<AA>>^A");
|
||||||
}
|
}
|
||||||
|
|
||||||
//#[test]
|
#[test]
|
||||||
//fn part1_1_back() {
|
fn part1_1_back() {
|
||||||
// let result = Keypad::revert_from(INPUT_1_BACK);
|
let result = Keypad::revert_from(INPUT_1_BACK);
|
||||||
// let result = Keypad::revert_from(&result);
|
println!("back 1 {result}");
|
||||||
// let result = Numpad::revert_from(&result);
|
let result = Keypad::revert_from(&result);
|
||||||
// assert_eq!(result, "029A");
|
println!("back 2 {result}");
|
||||||
//}
|
let result = Numpad::revert_from(&result);
|
||||||
|
assert_eq!(result, "029A");
|
||||||
|
}
|
||||||
|
|
||||||
//#[test]
|
#[test]
|
||||||
//fn part1_2_back() {
|
fn part1_2_back() {
|
||||||
// let result = Keypad::revert_from(INPUT_2_BACK);
|
let result = Keypad::revert_from(INPUT_2_BACK);
|
||||||
// let result = Keypad::revert_from(&result);
|
println!("back 1 {result}");
|
||||||
// let result = Numpad::revert_from(&result);
|
let result = Keypad::revert_from(&result);
|
||||||
// assert_eq!(result, "980A");
|
println!("back 2 {result}");
|
||||||
//}
|
let result = Numpad::revert_from(&result);
|
||||||
|
assert_eq!(result, "980A");
|
||||||
|
}
|
||||||
|
|
||||||
//#[test]
|
#[test]
|
||||||
//fn part1_3_back() {
|
fn part1_3_back() {
|
||||||
// let result = Keypad::revert_from(INPUT_3_BACK);
|
let result = Keypad::revert_from(INPUT_3_BACK);
|
||||||
// let result = Keypad::revert_from(&result);
|
println!("back 1 {result}");
|
||||||
// let result = Numpad::revert_from(&result);
|
let result = Keypad::revert_from(&result);
|
||||||
// assert_eq!(result, "179A");
|
println!("back 2 {result}");
|
||||||
//}
|
let result = Numpad::revert_from(&result);
|
||||||
|
assert_eq!(result, "179A");
|
||||||
|
}
|
||||||
|
|
||||||
//#[test]
|
#[test]
|
||||||
//fn part1_4_back() {
|
fn part1_4_back() {
|
||||||
// let result = Keypad::revert_from(INPUT_4_BACK);
|
let result = Keypad::revert_from(INPUT_4_BACK);
|
||||||
// let result = Keypad::revert_from(&result);
|
println!("back 1 {result}");
|
||||||
// let result = Numpad::revert_from(&result);
|
let result = Keypad::revert_from(&result);
|
||||||
// assert_eq!(result, "456A");
|
println!("back 2 {result}");
|
||||||
//}
|
let result = Numpad::revert_from(&result);
|
||||||
|
assert_eq!(result, "456A");
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn part1_5_back() {
|
fn part1_5_back() {
|
||||||
|
Loading…
Reference in New Issue
Block a user