SHARE
TWEET

pi.bas

a guest Jul 6th, 2019 117 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 10 RANDOMIZE TIMER
  2. 20 DIM X AS DOUBLE
  3. 30 DIM Y AS DOUBLE
  4. 40 LET C = 0
  5. 50 LET N = 100000000
  6. 60 FOR I = 1 TO N
  7. 70 X = RND * (1 - (-1)) + (-1)
  8. 80 Y = RND * (1 - (-1)) + (-1)
  9. 90 IF X^2 + Y^2 <= 1 THEN
  10. 100 C += 1
  11. 110 END IF
  12. 120 NEXT
  13. 130 PRINT 4 * (C / N)
  14. 140 END
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top