Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
danluu committed Apr 11, 2013
1 parent ccae209 commit aff5589
Showing 1 changed file with 40 additions and 34 deletions.
74 changes: 40 additions & 34 deletions src/libcore/rand.rs
Expand Up @@ -157,11 +157,11 @@ pub trait RngUtil {
*
* ~~~
*
* use core::rand::RngUtil;
* use core::rand::RngUtil;
*
* fn main() {
* rng = rand::Rng();
* println(fmt!("%d",rng.gen_int()));
* rng = rand::Rng();
* println(fmt!("%d",rng.gen_int()));
* }
* ~~~
*/
Expand Down Expand Up @@ -197,11 +197,11 @@ pub trait RngUtil {
*
* ~~~
*
* use core::rand::RngUtil;
* use core::rand::RngUtil;
*
* fn main() {
* rng = rand::Rng();
* println(fmt!("%f",rng.gen_float()));
* rng = rand::Rng();
* println(fmt!("%f",rng.gen_float()));
* }
* ~~~
*/
Expand All @@ -223,10 +223,10 @@ pub trait RngUtil {
*
* ~~~
*
* use core::rand::RngUtil;
* use core::rand::RngUtil;
*
* fn main() {
* rng = rand::Rng();
* rng = rand::Rng();
* println(fmt!("%b",rng.gen_bool()));
* }
* ~~~
Expand All @@ -239,11 +239,11 @@ pub trait RngUtil {
*
* ~~~
*
* use core::rand::RngUtil;
* use core::rand::RngUtil;
*
* fn main() {
* rng = rand::Rng();
* println(fmt!("%b",rng.gen_weighted_bool(3)));
* rng = rand::Rng();
* println(fmt!("%b",rng.gen_weighted_bool(3)));
* }
* ~~~
*/
Expand All @@ -255,11 +255,11 @@ pub trait RngUtil {
*
* ~~~
*
* use core::rand::RngUtil;
* use core::rand::RngUtil;
*
* fn main() {
* rng = rand::Rng();
* println(rng.gen_str(8));
* rng = rand::Rng();
* println(rng.gen_str(8));
* }
* ~~~
*/
Expand All @@ -271,28 +271,28 @@ pub trait RngUtil {
*
* ~~~
*
* use core::rand::RngUtil;
* use core::rand::RngUtil;
*
* fn main() {
* rng = rand::Rng();
* println(fmt!("%?",rng.gen_bytes(8)));
* rng = rand::Rng();
* println(fmt!("%?",rng.gen_bytes(8)));
* }
* ~~~
*/
fn gen_bytes(&self, len: uint) -> ~[u8];
///
///
/**
* Choose an item randomly, failing if values is empty
*
* *Example*
*
* ~~~
*
* use core::rand::RngUtil;
* use core::rand::RngUtil;
*
* fn main() {
* rng = rand::Rng();
* println(fmt!("%d",rng.choose([1,2,4,8,16,32])));
* rng = rand::Rng();
* println(fmt!("%d",rng.choose([1,2,4,8,16,32])));
* }
* ~~~
*/
Expand All @@ -307,11 +307,13 @@ pub trait RngUtil {
*
* ~~~
*
* use core::rand::RngUtil;
* use core::rand::RngUtil;
*
* fn main() {
* rng = rand::Rng();
* let x = [rand::Weighted {weight: 4, item: 'a'}, rand::Weighted {weight: 2, item: 'b'}, rand::Weighted {weight: 2, item: 'c'}];
* rng = rand::Rng();
* let x = [rand::Weighted {weight: 4, item: 'a'},
* rand::Weighted {weight: 2, item: 'b'},
* rand::Weighted {weight: 2, item: 'c'}];
* println(fmt!("%c",rng.choose_weighted(x)));
* }
* ~~~
Expand All @@ -325,11 +327,13 @@ pub trait RngUtil {
*
* ~~~
*
* use core::rand::RngUtil;
* use core::rand::RngUtil;
*
* fn main() {
* rng = rand::Rng();
* let x = [rand::Weighted {weight: 4, item: 'a'}, rand::Weighted {weight: 2, item: 'b'}, rand::Weighted {weight: 2, item: 'c'}];
* rng = rand::Rng();
* let x = [rand::Weighted {weight: 4, item: 'a'},
* rand::Weighted {weight: 2, item: 'b'},
* rand::Weighted {weight: 2, item: 'c'}];
* println(fmt!("%?",rng.choose_weighted_option(x)));
* }
* ~~~
Expand All @@ -343,11 +347,13 @@ pub trait RngUtil {
*
* ~~~
*
* use core::rand::RngUtil;
* use core::rand::RngUtil;
*
* fn main() {
* rng = rand::Rng();
* let x = [rand::Weighted {weight: 4, item: 'a'}, rand::Weighted {weight: 2, item: 'b'}, rand::Weighted {weight: 2, item: 'c'}];
* rng = rand::Rng();
* let x = [rand::Weighted {weight: 4, item: 'a'},
* rand::Weighted {weight: 2, item: 'b'},
* rand::Weighted {weight: 2, item: 'c'}];
* println(fmt!("%?",rng.weighted_vec(x)));
* }
* ~~~
Expand All @@ -360,10 +366,10 @@ pub trait RngUtil {
*
* ~~~
*
* use core::rand::RngUtil;
* use core::rand::RngUtil;
*
* fn main() {
* rng = rand::Rng();
* rng = rand::Rng();
* println(fmt!("%?",rng.shuffle([1,2,3])));
* }
* ~~~
Expand All @@ -376,10 +382,10 @@ pub trait RngUtil {
*
* ~~~
*
* use core::rand::RngUtil;
* use core::rand::RngUtil;
*
* fn main() {
* rng = rand::Rng();
* rng = rand::Rng();
* let mut y = [1,2,3];
* rng.shuffle_mut(y);
* println(fmt!("%?",y));
Expand Down

5 comments on commit aff5589

@bors
Copy link
Contributor

@bors bors commented on aff5589 Apr 11, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on aff5589 Apr 11, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging danluu/rust/rngdoc = aff5589 into auto

@bors
Copy link
Contributor

@bors bors commented on aff5589 Apr 11, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

danluu/rust/rngdoc = aff5589 merged ok, testing candidate = cf34b31

@bors
Copy link
Contributor

@bors bors commented on aff5589 Apr 11, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on aff5589 Apr 11, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding incoming to auto = cf34b31

Please sign in to comment.