solution: cleanup day25 part1
This commit is contained in:
parent
0000041006
commit
0000042080
|
@ -1,4 +1,7 @@
|
||||||
const ONE: u64 = 20151125;
|
const ONE: u64 = 20151125;
|
||||||
|
const MULTIPLY: u64 = 252533;
|
||||||
|
const MOD: u64 = 33554393;
|
||||||
|
|
||||||
pub fn part_one(input: &str) -> Option<u64> {
|
pub fn part_one(input: &str) -> Option<u64> {
|
||||||
let l = input.len();
|
let l = input.len();
|
||||||
let (row, column): (u32, u32) = input[80..l - 1]
|
let (row, column): (u32, u32) = input[80..l - 1]
|
||||||
|
@ -10,13 +13,13 @@ pub fn part_one(input: &str) -> Option<u64> {
|
||||||
let mut c = 1;
|
let mut c = 1;
|
||||||
let mut code = ONE;
|
let mut code = ONE;
|
||||||
while c < n {
|
while c < n {
|
||||||
code = (code * 252533) % 33554393;
|
code = (code * MULTIPLY) % MOD;
|
||||||
c += 1;
|
c += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
Some(code)
|
Some(code)
|
||||||
}
|
}
|
||||||
pub fn part_two(input: &str) -> Option<u32> {
|
pub fn part_two(_input: &str) -> Option<u32> {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
fn main() {
|
fn main() {
|
||||||
|
|
Loading…
Reference in New Issue