Advertisement
Guest User

Untitled

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