Guest User

Untitled

a guest
Jan 26th, 2020
89
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script>
  2.  
  3. var m = [0, 0, 0, 0];
  4. var all = 100000000;
  5. var win = 0;
  6.  
  7. for (var i = 0; i < all; i++) {
  8.     for (var j = 0; j < 4; j++) {
  9.         m[j] = Math.round(Math.random(1));
  10.     }
  11.     var i1 = (m[0] == 1) ? 1 : 3;
  12.     var i2 = (m[1] == 1) ? 0 : 2;
  13.     if (m[i1] == m[i2]) {
  14.         win++;
  15.     }
  16. }
  17.  
  18. document.write(win / all);
  19.  
  20. </script>
RAW Paste Data