Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defn dart [x] [y]
- (def throws 10)
- (def hits 0.0)
- (def Rsquared (+ (* (- 0.5 x) (- 0.5 x)) (* (- 0.5 y) (- 0.5 y)) ) )
- (println Rsquared)
- (if (< Rsquared 0.25) (def hits (+ hits 1)))
- (def pi (* 4 (/ hits throws)) )
- (println pi)
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement