Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ryanmr
Last active August 29, 2015 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanmr/1198afd0ba416734386c to your computer and use it in GitHub Desktop.
Save ryanmr/1198afd0ba416734386c to your computer and use it in GitHub Desktop.
use std::io;
use std::rand;
struct Monte {
h: uint,
k: uint,
r: uint
}
fn main() {
}
fn findPi() {
let h = 5u;
let k = 3u;
let r = 2u;
let n = 10000000u;
let mut square_count = 0u;
let mut circle_count = 0u;
// TODO
}
fn monte_next_x(monte: Monte) -> f64 {
let a: f64 = (monte.h - monte.r) as f64;
let b: f64 = (2u * monte.r) as f64;
return a + b * rand::random::<f64>();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment