remove println
parent
d4c02b30de
commit
765e0d90cf
|
@ -113,7 +113,6 @@ impl Map {
|
||||||
matches.push(m);
|
matches.push(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
println!("matches {:?}", matches);
|
|
||||||
let mut res: Vec<Option<Pair>> = vec![];
|
let mut res: Vec<Option<Pair>> = vec![];
|
||||||
for &(r1, r2) in matches.iter() {
|
for &(r1, r2) in matches.iter() {
|
||||||
let mut rows_matched = 0;
|
let mut rows_matched = 0;
|
||||||
|
@ -121,13 +120,6 @@ impl Map {
|
||||||
loop {
|
loop {
|
||||||
let start = r1 - rows_matched;
|
let start = r1 - rows_matched;
|
||||||
let end = r2 + 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] {
|
if board[start] == board[end] {
|
||||||
rows_matched += 1;
|
rows_matched += 1;
|
||||||
} else {
|
} else {
|
||||||
|
@ -145,10 +137,6 @@ impl Map {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
println!(
|
|
||||||
"{},{} rows matched {} diff_chars {}",
|
|
||||||
r1, r2, rows_matched, diff_chars
|
|
||||||
);
|
|
||||||
|
|
||||||
if diff_chars == 1 {
|
if diff_chars == 1 {
|
||||||
res.push(Some((r1, r2)));
|
res.push(Some((r1, r2)));
|
||||||
|
@ -165,29 +153,20 @@ impl Map {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_horiz_smudge(&self) -> Option<usize> {
|
fn get_horiz_smudge(&self) -> Option<usize> {
|
||||||
println!("get horiz smudge");
|
if let Some((_r1, r2)) = self.find_smudge(&self.rows) {
|
||||||
if let Some((r1, r2)) = self.find_smudge(&self.rows) {
|
|
||||||
println!("got horiz smudge rows of {},{}", r1, r2);
|
|
||||||
return Some(100 * r2);
|
return Some(100 * r2);
|
||||||
}
|
}
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_vert_smudge(&self) -> Option<usize> {
|
fn get_vert_smudge(&self) -> Option<usize> {
|
||||||
println!("get vert smudge");
|
if let Some((_c1, c2)) = self.find_smudge(&self.cols) {
|
||||||
if let Some((c1, c2)) = self.find_smudge(&self.cols) {
|
|
||||||
println!("got vert smudge cols of {},{}", c1, c2);
|
|
||||||
return Some(c2);
|
return Some(c2);
|
||||||
}
|
}
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
||||||
fn part2(&self) -> usize {
|
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 hscore = self.get_horiz_smudge();
|
||||||
let vscore = self.get_vert_smudge();
|
let vscore = self.get_vert_smudge();
|
||||||
if hscore.is_some() && vscore.is_some() {
|
if hscore.is_some() && vscore.is_some() {
|
||||||
|
|
Loading…
Reference in New Issue