Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def next():
- ret = 0
- for i in range(26):
- ret <<= 1 # Rotate left, add the lowest bit from the state
- ret |= state & 1
- state = (state << 1) ^ (state >> 61) # Rotate left, move upper bit to lowest bit
- state &= 0xFFFFFFFFFFFFFFFF #
- cur0 = state & 0x8888888888888888
- cur1 = state & 0x1111111111111111
- state = state ^ (cur0 >> 2) ^ (cur0 >> 3) ^ (cur1 << 2) ^ (cur1 << 3)
- return ret
- # next() = 20016517 = 0b01001100010110110110000101
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement