Last active
August 29, 2015 14:11
-
-
Save ryanmr/1198afd0ba416734386c to your computer and use it in GitHub Desktop.
This file contains 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::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