day(13): take the factor out of helper function
Signed-off-by: Matej Focko <mfocko@redhat.com>
This commit is contained in:
parent
a41963a338
commit
b3e7037f33
1 changed files with 2 additions and 2 deletions
|
@ -42,14 +42,14 @@ impl Pattern {
|
||||||
.count()
|
.count()
|
||||||
== allowed_error
|
== allowed_error
|
||||||
})
|
})
|
||||||
.map(|y| 100 * (y + 1) as i32)
|
.map(|y| (y + 1) as i32)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn score(&self, allowed_error: usize) -> i32 {
|
fn score(&self, allowed_error: usize) -> i32 {
|
||||||
if let Some(s) = self.check_vertically(allowed_error) {
|
if let Some(s) = self.check_vertically(allowed_error) {
|
||||||
s
|
s
|
||||||
} else if let Some(s) = self.check_horizontally(allowed_error) {
|
} else if let Some(s) = self.check_horizontally(allowed_error) {
|
||||||
s
|
100 * s
|
||||||
} else {
|
} else {
|
||||||
unreachable!()
|
unreachable!()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue