Skip to content

Instantly share code, notes, and snippets.

View solson's full-sized avatar

Scott Olson solson

  • Canada/Ireland
  • 09:40 (UTC +01:00)
View GitHub Profile
@solson
solson / playground.rs
Created December 16, 2017 21:48 — forked from anonymous/playground.rs
Rust code shared from the playground
use std::cmp::{max, min};
const _INPUT: &str = "\
5 1 9 5
7 5 3
2 4 6 8\
";
const INPUT: &str = "\
62 1649 1731 76 51 1295 349 719 52 1984 2015 2171 981 1809 181 1715
@solson
solson / playground.rs
Created December 16, 2017 20:37 — forked from anonymous/playground.rs
Rust code shared from the playground
#![feature(inclusive_range_syntax)]
const INPUT: isize = 289326;
#[derive(Clone, Copy, Debug)]
struct Vec2 {
x: isize,
y: isize,
}
@solson
solson / playground.rs
Created December 16, 2017 19:59 — forked from anonymous/playground.rs
Rust code shared from the playground
const INPUT: isize = 289326;
#[derive(Clone, Copy, Debug)]
struct Vec2 {
x: isize,
y: isize,
}
fn main() {
let mut pos = Vec2 { x: 0, y: 0 };
@solson
solson / playground.rs
Created December 16, 2017 18:02 — forked from anonymous/playground.rs
Rust code shared from the playground
const INPUT: &[u8] = b"\
kvvfl kvvfl olud wjqsqa olud frc
slhm rdfm yxb rsobyt rdfm
pib wzfr xyoakcu zoapeze rtdxt rikc jyeps wdyo hawr xyoakcu hawr
ismtq qwoi kzt ktgzoc gnxblp dzfayil ftfx asscba ionxi dzfayil qwoi
dzuhys kfekxe nvdhdtj hzusdy xzhehgc dhtvdnj oxwlvef
gxg qahl aaipx tkmckn hcsuhy jsudcmy kcefhpn kiasaj tkmckn
roan kqnztj edc zpjwb
yzc roc qrygby rsvts nyijgwr xnpqz
jqgj hhgtw tmychia whkm vvxoq tfbzpe ska ldjmvmo
@solson
solson / playground.rs
Created December 16, 2017 17:58 — forked from anonymous/playground.rs
Rust code shared from the playground
const INPUT: &str = "\
kvvfl kvvfl olud wjqsqa olud frc
slhm rdfm yxb rsobyt rdfm
pib wzfr xyoakcu zoapeze rtdxt rikc jyeps wdyo hawr xyoakcu hawr
ismtq qwoi kzt ktgzoc gnxblp dzfayil ftfx asscba ionxi dzfayil qwoi
dzuhys kfekxe nvdhdtj hzusdy xzhehgc dhtvdnj oxwlvef
gxg qahl aaipx tkmckn hcsuhy jsudcmy kcefhpn kiasaj tkmckn
roan kqnztj edc zpjwb
yzc roc qrygby rsvts nyijgwr xnpqz
jqgj hhgtw tmychia whkm vvxoq tfbzpe ska ldjmvmo
@solson
solson / playground.rs
Created December 16, 2017 17:50 — forked from anonymous/playground.rs
Rust code shared from the playground
const _INPUT: &str = "\
0
3
0
1
-3\
";
const INPUT: &str = "\
0
@solson
solson / playground.rs
Created December 16, 2017 17:27 — forked from anonymous/playground.rs
Rust code shared from the playground
use std::collections::HashMap;
use std::collections::hash_map::Entry;
const _INPUT: [u64; 4] = [0, 2, 7, 0];
const INPUT: [u64; 16] = [5, 1, 10, 0, 1, 7, 13, 14, 3, 12, 8, 10, 7, 12, 0, 6];
fn main() {
let mut banks = INPUT;
let mut seen = HashMap::new();
@solson
solson / playground.rs
Created December 16, 2017 16:46 — forked from anonymous/playground.rs
Rust code shared from the playground
use std::collections::{HashMap, HashSet};
const _INPUT: &str = "\
pbga (66)
xhth (57)
ebii (61)
havc (66)
ktlj (57)
fwft (72) -> ktlj, cntj, xhth
qoyq (66)
@solson
solson / playground.rs
Created December 16, 2017 15:20 — forked from anonymous/playground.rs
Rust code shared from the playground
use std::collections::HashMap;
const _INPUT: &str = "\
pbga (66)
xhth (57)
ebii (61)
havc (66)
ktlj (57)
fwft (72) -> ktlj, cntj, xhth
qoyq (66)
@solson
solson / playground.rs
Created December 16, 2017 15:07 — forked from anonymous/playground.rs
Rust code shared from the playground
use std::collections::HashMap;
use std::cmp::Ordering::*;
use std::cmp::max;
const _INPUT: &str = "\
b inc 5 if a > 1
a inc 1 if b < 5
c dec -10 if a >= 1
c inc -20 if c == 10\
";