mirror of
https://github.com/TACIXAT/XorShift128Plus
synced 2024-09-27 20:58:13 +00:00
Added note about Chrome's way to get doubles. Added readme content.
This commit is contained in:
parent
fdaf830594
commit
a12e7e3c10
17
README
17
README
@ -0,0 +1,17 @@
|
|||||||
|
For usage on the LA Time's powerball simulator. Careful about clicking the page.
|
||||||
|
|
||||||
|
Run the following snippet in your browser's console.
|
||||||
|
|
||||||
|
_ = []; for(var i=0; i<5; ++i) { _.push(Math.random()) } ; console.log(_)
|
||||||
|
|
||||||
|
Paste at least 3 of those values into the dubs array in main().
|
||||||
|
|
||||||
|
Set the browser in main() to Chrome or Firefox. (Safari hasn't updated yet.)
|
||||||
|
|
||||||
|
python xs128p.py
|
||||||
|
|
||||||
|
The winning numbers should have an arrow. Click once on the number inputs and tab between them to enter your "pick".
|
||||||
|
|
||||||
|
Click once on the play button.
|
||||||
|
|
||||||
|
Enjoy your lotto winnings :)
|
@ -2,7 +2,7 @@ import sys
|
|||||||
import math
|
import math
|
||||||
import struct
|
import struct
|
||||||
import random
|
import random
|
||||||
sys.path.append('/path/to/z3/build/')
|
sys.path.append('/home/dgoddard/tools/z3/build/')
|
||||||
from z3 import *
|
from z3 import *
|
||||||
|
|
||||||
# xor_shift_128_plus algorithm
|
# xor_shift_128_plus algorithm
|
||||||
@ -90,7 +90,7 @@ def power_ball(generated, browser):
|
|||||||
# Firefox nextDouble():
|
# Firefox nextDouble():
|
||||||
# (rand_uint64 & ((1 << 53) - 1)) / (1 << 53)
|
# (rand_uint64 & ((1 << 53) - 1)) / (1 << 53)
|
||||||
# Chrome nextDouble():
|
# Chrome nextDouble():
|
||||||
# (rand_uint64 & ((1 << 52) - 1)) | 0x3FF0000000000000
|
# ((rand_uint64 & ((1 << 52) - 1)) | 0x3FF0000000000000) - 1.0
|
||||||
# Safari weakRandom.get():
|
# Safari weakRandom.get():
|
||||||
# (rand_uint64 & ((1 << 53) - 1) * (1.0 / (1 << 53)))
|
# (rand_uint64 & ((1 << 53) - 1) * (1.0 / (1 << 53)))
|
||||||
|
|
||||||
@ -102,7 +102,7 @@ def main():
|
|||||||
browser = 'chrome'
|
browser = 'chrome'
|
||||||
# browser = 'firefox'
|
# browser = 'firefox'
|
||||||
print 'BROWSER: %s' % browser
|
print 'BROWSER: %s' % browser
|
||||||
|
|
||||||
# In your browser's JavaScript console:
|
# In your browser's JavaScript console:
|
||||||
# _ = []; for(var i=0; i<5; ++i) { _.push(Math.random()) } ; console.log(_)
|
# _ = []; for(var i=0; i<5; ++i) { _.push(Math.random()) } ; console.log(_)
|
||||||
# Enter at least 3 random numbers you observed here:
|
# Enter at least 3 random numbers you observed here:
|
||||||
|
Loading…
Reference in New Issue
Block a user