Developer builds constraint-based group splitter that avoids true randomness entirely
A developer set out to build a simple name-list group splitter but discovered that real-world use cases almost always involve constraints, such as keeping certain people apart or distributing roles evenly across groups. The resulting tool contains no Math.random() in its core logic, instead using a deterministic, rule-aware placement algorithm. It first parses and deduplicates names from various input formats, then sorts people by how constrained they are before greedily assigning the most restricted individuals to groups first. The approach mirrors the intuition of packing a suitcase — fitting awkward items in while space is flexible, then filling gaps with easier ones. The trade-off is that two people sharing the same name are silently merged, since the tool treats the name string itself as the unique identifier.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in