1
0
Fork 0

remove println

main
Andrew Coleman 2023-12-24 16:49:25 -05:00
parent d4c02b30de
commit 765e0d90cf
1 changed files with 2 additions and 23 deletions

View File

@ -113,7 +113,6 @@ impl Map {
matches.push(m);
}
println!("matches {:?}", matches);
let mut res: Vec<Option<Pair>> = vec![];
for &(r1, r2) in matches.iter() {
let mut rows_matched = 0;
@ -121,13 +120,6 @@ impl Map {
loop {
let start = r1 - rows_matched;
let end = r2 + rows_matched;
println!(
"comparing {} to {} with {} and {}",
start,
end,
board[start].iter().collect::<String>(),
board[end].iter().collect::<String>(),
);
if board[start] == board[end] {
rows_matched += 1;
} else {
@ -145,10 +137,6 @@ impl Map {
break;
}
}
println!(
"{},{} rows matched {} diff_chars {}",
r1, r2, rows_matched, diff_chars
);
if diff_chars == 1 {
res.push(Some((r1, r2)));
@ -165,29 +153,20 @@ impl Map {
}
fn get_horiz_smudge(&self) -> Option<usize> {
println!("get horiz smudge");
if let Some((r1, r2)) = self.find_smudge(&self.rows) {
println!("got horiz smudge rows of {},{}", r1, r2);
if let Some((_r1, r2)) = self.find_smudge(&self.rows) {
return Some(100 * r2);
}
None
}
fn get_vert_smudge(&self) -> Option<usize> {
println!("get vert smudge");
if let Some((c1, c2)) = self.find_smudge(&self.cols) {
println!("got vert smudge cols of {},{}", c1, c2);
if let Some((_c1, c2)) = self.find_smudge(&self.cols) {
return Some(c2);
}
None
}
fn part2(&self) -> usize {
println!();
for line in self.rows.iter() {
println!("{}", line.iter().collect::<String>());
}
println!("width {} height {}", self.width, self.height);
let hscore = self.get_horiz_smudge();
let vscore = self.get_vert_smudge();
if hscore.is_some() && vscore.is_some() {