hard20 pts · first answer countsgame-architecturerandomness
Biased card shuffle
This shuffle swaps each position with any random position. Why is it biased?
for (let i = 0; i < n; i++) {
const j = randInt(0, n - 1)
swap(a, i, j)
}Discussion 0
Join free to post in the discussion.
Related questions
- Variable and fixed timestepsGame Developer
- Jump pressed just before landingGame Developer
- Jumping just after leaving a ledgeGame Developer
- Why games pool objectsGame Developer
- Decoupling achievements from combatGame Developer
- A flying, swimming, shooting enemyGame Developer
- Enemy with patrol, chase and attackGame Developer
- What to put in a save fileGame Developer