~cdv/aoc-2018-rs

983d968f5d9e083b60b34ab3f643f618a2794df0 — Christopher Vittal 2 years ago bfe770e
rustfmt
1 files changed, 4 insertions(+), 3 deletions(-)

M src/bin/day14.rs
M src/bin/day14.rs => src/bin/day14.rs +4 -3
@@ 16,13 16,14 @@ fn main() {
        e2 = (e2 + st[e2] as usize + 1) % st.len();
    }
    print!("  1: ");
    for i in &st[input..input+10] {
    for i in &st[input..input + 10] {
        print!("{}", i);
    }
    println!();
    // reset for p2
    st.clear();
    st.push(3); st.push(7);
    st.push(3);
    st.push(7);
    let mut e1 = 0;
    let mut e2 = 1;
    let mut p = 0;


@@ 36,7 37,7 @@ fn main() {
        e2 = (e2 + st[e2] as usize + 1) % st.len();
        while p + inarr.len() < st.len() {
            //println!("{:15}: {:?}", p, &st[p..p+INARR.len()]);
            if inarr == &st[p..p+inarr.len()] {
            if inarr == &st[p..p + inarr.len()] {
                break 'out p;
            }
            p += 1;