CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-unique-random

Generate random numbers that are consecutively unique

90

1.13x
Overview
Eval results
Files

rubric.jsonevals/scenario-3/

{
  "context": "Evaluates whether the solution builds the required non-repeating number streams by applying unique-random's callable-and-iterable generators and exposing their intersection typing correctly. Focuses on selecting the right factory per strategy, keeping call/iteration state shared, and avoiding general code-style concerns.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Cycle factory",
      "description": "Uses unique-random's exhaustiveUniqueRandom(minimum, maximum) for the default 'cycle' strategy so values exhaust the full range before any repeat and still avoid immediate repeats at cycle boundaries.",
      "max_score": 30
    },
    {
      "name": "No-repeat factory",
      "description": "Uses unique-random's consecutiveUniqueRandom(minimum, maximum) for the 'no-repeat' strategy to guarantee consecutive draws (whether via calls or iteration) never return the same number twice in a row.",
      "max_score": 25
    },
    {
      "name": "Callable iterable type",
      "description": "Returns a generator that remains both callable and iterable without losing its [Symbol.iterator] implementation, and types it in TypeScript as an intersection like (() => number) & { [Symbol.iterator](): Iterator<number> } to mirror unique-random's definitions.",
      "max_score": 20
    },
    {
      "name": "Shared state",
      "description": "Ensures direct calls and iteration use the same underlying unique-random generator instance (no re-instantiation), so mixed consumption draws from a single shared sequence.",
      "max_score": 15
    },
    {
      "name": "Single-value handling",
      "description": "Relies on unique-random's factories to handle minimum === maximum without extra custom logic, preserving the callable-and-iterable surface while yielding the constant value.",
      "max_score": 10
    }
  ]
}

Install with Tessl CLI

npx tessl i tessl/npm-unique-random

tile.json