Skip to content

Instantly share code, notes, and snippets.

View sliminality's full-sized avatar

Slim sliminality

View GitHub Profile
@sliminality
sliminality / playground.rs
Created May 25, 2017 15:56 — forked from anonymous/playground.rs
Rust code shared from the playground
struct Tree<'a> {
pawns: Vec<usize>,
rolls: Vec<usize>,
pawns_iter: std::slice::Iter<'a, usize>,
rolls_iter: std::slice::Iter<'a, usize>,
}
impl<'a> Tree<'a> {
fn new(pawns: Vec<usize>, rolls: Vec<usize>) -> Tree<'a> {
Tree {
@sliminality
sliminality / playground.rs
Created May 24, 2017 03:08 — forked from anonymous/playground.rs
Rust code shared from the playground
use std::sync::{Arc, Mutex};
use std::thread;
use std::sync::mpsc;
fn main() {
let v = vec![1, 2];
println!("{:?}", v.iter().map(|x| x.to_string()).collect::<Vec<_>>().join(" "));
let mut iter = (0..4).zip((0..6));
for (x, y) in iter {
@sliminality
sliminality / playground.rs
Created May 14, 2017 22:37 — forked from anonymous/playground.rs
Rust code shared from the playground
#![allow(dead_code)]
extern crate rand;
use rand::Rng;
use std::sync::{Arc, Mutex};
// use std::time::Duration;
use std::thread;
use std::sync::mpsc;
fn partition(arr: &mut [i32]) -> usize {