import Foundation func mcpi(sampleSize size:Int) -> Double { var x = 0 as Double var y = 0 as Double var m = 0 as Double for i in 0..