daily pastebin goal
10%
SHARE
TWEET

Untitled

a guest Feb 17th, 2019 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. use rand::prelude::*;
  2.  
  3. fn main() {
  4.     let scramble_string = String::from("Hello");
  5.  
  6.     let random_thing = rand::thread_rng().gen_range(0, scramble_string.len());
  7.  
  8.    
  9.  
  10.     let mut sv1: Vec<char> = Vec::new();
  11.    
  12.     let vlen = 5;
  13.  
  14.     let mut sv2 = vec![' '; vlen];
  15.  
  16.     for i in scramble_string.chars() {
  17.         sv1.push(i);
  18.     }
  19.  
  20.  
  21.     for i in scramble_string.chars() {
  22.         sv1.push(i);
  23.         sv2.push(sv1[random_thing]);
  24.     }
  25.    
  26.     println!("{:?}", sv1);
  27.     println!("{:?}", sv2);
  28.     println!("{:?}", random_thing);
  29.    
  30.  
  31. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top