Guest User

Untitled

a guest
Sep 19th, 2010
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. (def throws 10)
  2. (def hits 0.0)
  3.  
  4. (def Rsquared [x] [y]
  5. (+ (* (- 0.5 x) (- 0.5 x)) (* (- 0.5 y) (- 0.5 y)) ) )
  6. (println Rsquared)
  7. (if (< Rsquared 0.25) (def hits (+ hits 1)))
  8. (def pi (* 4 (/ hits throws)) )
  9. (println pi)
  10. )
Advertisement
Add Comment
Please, Sign In to add comment