This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![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 { |