Skip to content

Instantly share code, notes, and snippets.

View chrisvittal's full-sized avatar

Christopher Vittal chrisvittal

View GitHub Profile
@chrisvittal
chrisvittal / day19.rs
Created December 19, 2017 05:50
Advent of Code Day 19
const INPUT: &'static str = include_str!("../../data/day19");
fn main() {
let input: Vec<Vec<u8>> = INPUT.lines().map(|l| l.bytes().collect()).collect();
let x = input[0].iter().position(|&b| b == b'|').unwrap();
let mut path = Path::new(x, 0, &input);
while path.step() {}
println!("1: {}", unsafe { ::std::str::from_utf8_unchecked(&path.seen) });
println!("2: {}", path.count);

Keybase proof

I hereby claim:

  • I am chrisvittal on github.
  • I am cvittal (https://keybase.io/cvittal) on keybase.
  • I have a public key whose fingerprint is B1E2 1672 DFCE 15A0 1FB0 AE78 D76E 0937 44A9 8127

To claim this, I am signing this object: