Skip to content

Instantly share code, notes, and snippets.

Last active Aug 29, 2015
What would you like to do?
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;
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