diff options
author | Jesse Luehrs <doy@tozt.net> | 2022-12-11 22:09:16 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2022-12-11 22:19:17 -0500 |
commit | 70f6149889511f61f91f525eba5a82e938cb41ec (patch) | |
tree | 20ed08e39ee1d0c7ec561721231f36e98a89c1b9 /src/bin/2021/day13.rs | |
parent | e2d219b331a878bbb3c9dcef9ea4e218b2e3ee06 (diff) | |
download | advent-of-code-70f6149889511f61f91f525eba5a82e938cb41ec.tar.gz advent-of-code-70f6149889511f61f91f525eba5a82e938cb41ec.zip |
support string solutions
Diffstat (limited to 'src/bin/2021/day13.rs')
-rw-r--r-- | src/bin/2021/day13.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/bin/2021/day13.rs b/src/bin/2021/day13.rs index 75e547b..b21071f 100644 --- a/src/bin/2021/day13.rs +++ b/src/bin/2021/day13.rs @@ -122,13 +122,12 @@ pub fn part1( pub fn part2( (mut paper, folds): (Paper, Vec<(bool, usize)>), -) -> Result<usize> { +) -> Result<String> { for fold in folds { paper.fold(fold.0, fold.1); } - println!("{}", paper); - Ok(paper.total()) + Ok(ocr(&paper.to_string())) } #[test] @@ -139,6 +138,6 @@ fn test() { ); assert_eq!( part2(parse(parse::data(2021, 13).unwrap()).unwrap()).unwrap(), - 95 + "ECFHLHZF" ); } |