Generate random numbers that are consecutively unique
90
{
"context": "Evaluates how well the solution uses the unique-random generators as callable-and-iterable sources to build a shared stream across direct calls and for-of iteration. Focus is on picking the correct factory, reusing one generator, and leveraging its built-in bounds and consecutive-uniqueness guarantees instead of manual randomness.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Factory choice",
"description": "Creates the random source via a unique-random factory (`consecutiveUniqueRandom` or `exhaustiveUniqueRandom`) with the provided bounds instead of hand-rolling randomness.",
"max_score": 25
},
{
"name": "Shared reuse",
"description": "Uses a single generator instance for both `next()` and `take()` so direct invocation and iteration draw from the same stream without re-creating or resetting it.",
"max_score": 30
},
{
"name": "Iterable draw",
"description": "Implements batch collection in `take()` by iterating the generator (e.g., `for...of` or `[Symbol.iterator]`) rather than repeated manual calls or new generators, proving awareness that the generator is iterable.",
"max_score": 20
},
{
"name": "Bound reliance",
"description": "Relies on the factory's inclusive min/max handling instead of adding extra bound checks or secondary random generation to enforce range.",
"max_score": 10
},
{
"name": "No repeats via API",
"description": "Leverages the unique-random consecutive-uniqueness behavior (from `consecutiveUniqueRandom` or `exhaustiveUniqueRandom`) to satisfy the no-immediate-repeat requirement without custom de-duplication loops.",
"max_score": 15
}
]
}Install with Tessl CLI
npx tessl i tessl/npm-unique-random