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()
|
||||
== allowed_error
|
||||
})
|
||||
.map(|y| 100 * (y + 1) as i32)
|
||||
.map(|y| (y + 1) as i32)
|
||||
}
|
||||
|
||||
fn score(&self, allowed_error: usize) -> i32 {
|
||||
if let Some(s) = self.check_vertically(allowed_error) {
|
||||
s
|
||||
} else if let Some(s) = self.check_horizontally(allowed_error) {
|
||||
s
|
||||
100 * s
|
||||
} else {
|
||||
unreachable!()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue