Advertisement
Guest User

Untitled

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