Skip to content

Instantly share code, notes, and snippets.

View solson's full-sized avatar

Scott Olson solson

  • Canada/Ireland
  • 14:13 (UTC +01:00)
View GitHub Profile
@solson
solson / playground.rs
Created December 20, 2017 06:49 — forked from anonymous/playground.rs
Rust code shared from the playground
const INPUT: &str = "\
p=<1609,-863,-779>, v=<-15,54,-69>, a=<-10,0,14>
p=<-391,1353,-387>, v=<-94,-42,0>, a=<14,-5,3>
p=<3329,-143,333>, v=<-29,9,-45>, a=<-21,0,3>
p=<1751,3779,3413>, v=<-8,-57,-80>, a=<-5,-8,-5>
p=<-3241,1019,17>, v=<75,8,-26>, a=<5,-4,2>
p=<-1333,3071,2369>, v=<133,-15,51>, a=<-6,-9,-12>
p=<-3961,-2905,-1111>, v=<-20,59,46>, a=<15,5,0>
p=<-109,2663,-3655>, v=<7,-48,102>, a=<0,-5,4>
p=<-4417,2387,2021>, v=<99,-149,-72>, a=<7,4,-1>
@solson
solson / playground.rs
Created December 20, 2017 06:01 — forked from anonymous/playground.rs
Rust code shared from the playground
const INPUT: &str = "\
p=<1609,-863,-779>, v=<-15,54,-69>, a=<-10,0,14>
p=<-391,1353,-387>, v=<-94,-42,0>, a=<14,-5,3>
p=<3329,-143,333>, v=<-29,9,-45>, a=<-21,0,3>
p=<1751,3779,3413>, v=<-8,-57,-80>, a=<-5,-8,-5>
p=<-3241,1019,17>, v=<75,8,-26>, a=<5,-4,2>
p=<-1333,3071,2369>, v=<133,-15,51>, a=<-6,-9,-12>
p=<-3961,-2905,-1111>, v=<-20,59,46>, a=<15,5,0>
p=<-109,2663,-3655>, v=<7,-48,102>, a=<0,-5,4>
p=<-4417,2387,2021>, v=<99,-149,-72>, a=<7,4,-1>
@solson
solson / playground.rs
Created December 19, 2017 10:58 — forked from anonymous/playground.rs
Rust code shared from the playground
use std::str;
const INPUT: &[u8] = b"
|
+-------------------------------------------------------------------------------------------------------+ +-+ +---------------------------------------|-------------+
| | | | | | |
| +-+ +-------+ +-------------------------------------------------------------------+ +-----------|-----+ +-----+ +---+ | +-+ +---|-+
| | | | | | | | | | |
@solson
solson / playground.rs
Created December 19, 2017 10:56 — forked from anonymous/playground.rs
Rust code shared from the playground
use std::str;
const INPUT: &[u8] = b"
|
+-------------------------------------------------------------------------------------------------------+ +-+ +---------------------------------------|-------------+
| | | | | | |
| +-+ +-------+ +-------------------------------------------------------------------+ +-----------|-----+ +-----+ +---+ | +-+ +---|-+
| | | | | | | | | | |
@solson
solson / playground.rs
Created December 18, 2017 06:20 — forked from anonymous/playground.rs
Rust code shared from the playground
use std::collections::VecDeque;
const _INPUT_1: &str = "\
set a 1
add a 2
mul a a
mod a 5
snd a
set a 0
rcv a
@solson
solson / playground.rs
Created December 17, 2017 06:11 — forked from anonymous/playground.rs
Rust code shared from the playground
const _INPUT: usize = 3;
const INPUT: usize = 369;
fn main() {
let mut after_0 = None;
let mut pos = 0;
let mut buffer_len = 1;
for new_val in 1..50000001 {
pos = (pos + INPUT) % buffer_len;
@solson
solson / playground.rs
Created December 17, 2017 05:51 — forked from anonymous/playground.rs
Rust code shared from the playground
const _INPUT: usize = 3;
const INPUT: usize = 369;
fn main() {
let mut buffer = vec![0];
let mut pos = 0;
for new_val in 1..2018 {
pos = (pos + INPUT) % buffer.len();
buffer.insert(pos + 1, new_val);
@solson
solson / playground.rs
Created December 16, 2017 22:10 — forked from anonymous/playground.rs
Rust code shared from the playground
const INPUT: &[u8] = b"59945212267958384861888721899525514753529291453572849834636789447772281393981176491298438538371242283536895511781293535483317797837429153613432291415383346882548197148136644392687919782155536777728388533288353454847112297674777299484733912287764864566862651148756865369264986344956956922521593739716315435946569544941171492946488766611575348519389339547876121464365711831444946799524523259892124812191396861381393149158527746287184435324155247766428771317633594138229866193128628896894723977769686621487531877677937626541334293495153243338777879254655415885849888271366763761288878191616724671425792619954827318789792845732465336888352263526911221698478329435137589241942323459887267417892473791843197823877576131387428178263163762334435218578816782286948636819714454426632514231841776289778999639199975294683549535486129666995267186491327899225845245566977151331633764632562251818332576928213316655326812882169494512768444191542454234341418349139518545512533397855333959498151156228115659992525552349
@solson
solson / playground.rs
Created December 16, 2017 22:07 — forked from anonymous/playground.rs
Rust code shared from the playground
const INPUT: &[u8] = b"59945212267958384861888721899525514753529291453572849834636789447772281393981176491298438538371242283536895511781293535483317797837429153613432291415383346882548197148136644392687919782155536777728388533288353454847112297674777299484733912287764864566862651148756865369264986344956956922521593739716315435946569544941171492946488766611575348519389339547876121464365711831444946799524523259892124812191396861381393149158527746287184435324155247766428771317633594138229866193128628896894723977769686621487531877677937626541334293495153243338777879254655415885849888271366763761288878191616724671425792619954827318789792845732465336888352263526911221698478329435137589241942323459887267417892473791843197823877576131387428178263163762334435218578816782286948636819714454426632514231841776289778999639199975294683549535486129666995267186491327899225845245566977151331633764632562251818332576928213316655326812882169494512768444191542454234341418349139518545512533397855333959498151156228115659992525552349
@solson
solson / playground.rs
Created December 16, 2017 21:55 — forked from anonymous/playground.rs
Rust code shared from the playground
const _INPUT_1: &str = "\
5 1 9 5
7 5 3
2 4 6 8\
";
const _INPUT_2: &str = "\
5 9 2 8
9 4 7 3
3 8 6 5\