Meanwhile, back in 2013: https://forums.cardhunter.com/threads/enemy-rolls-seem-anything-but-random.727/
Interesting analysis, but what really caught my eye as a programmer was this trick I've somehow never seen before: Code: if (j != i) { // Classic XOR-based swap deck[i] ^= deck[j]; // C1 = C1_orig xor C2_orig deck[j] ^= deck[i]; // C2 = C2_orig xor C1_orig xor C2_orig = C1_orig deck[i] ^= deck[j]; // C1 = C1_orig xor C2_orig xor C1_orig = C2_orig } Also, in case anyone needs a translation... Spoiler: Sentient_Toaster said:
I love that swapping technique, but every time I use it, I have to go through it to remember what's going on and convince myself it's not witchcraft =D