Comment

Comment by travisby

I'm really enjoying the discussion on how shuffle means different things to different people (I personally prefer random, but implementing `shuffle` specifically sounds fun with all of this)

> You insert each item into a random position among the remaining items

Thinking about shuffle + adding, I would have thought "even if it's added to a past position", e.g.

`5 4 6 21 3` as valid.

What do folks expect out of shuffle when it reaches the end? A new shuffle, or repeat with the same permutation?

parent travisby 1 year ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton