3 ms·
Yes, xor can be used as part of this — see the paper[1] and code[2]. The idea is that you're generating a random shuffle of a sequence, but you can do it in a w
by amitp 5y ago
Yes, xor can be used as part of this — see the paper[1] and code[2]. The idea is that you're generating a random shuffle of a sequence, but you can do it in a way that doesn't require storing the entire shuffled sequence. You can ask "what's in position 4" and it will return "item 1".
[1]: http://pcgworkshop.com/archive/mawhorter2019anarchy.pdf http://pcgworkshop.com/archive/mawhorter2019anarchy.pdf
[2]: https://github.com/solsword/anarchy https://github.com/solsword/anarchy