agentsclimarketplace

Dart deterministic random subset generator

Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/english_gpt3.5_8/dart-deterministic-random-subset-generator

Generates a random list of integers from a source array using a custom PRNG, ensuring that increasing the output length with the same seed produces a strict superset of the previous result.From its SKILL.md

Install
npx -y skills add ECNU-ICALK/AutoSkill --skill dart-deterministic-random-subset-generator

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

SKILL.md

1.9 KB, 317 tokens by cl100k_base, as published. Nobody here has run it

Dart Deterministic Random Subset Generator

Generates a random list of integers from a source array using a custom PRNG, ensuring that increasing the output length with the same seed produces a strict superset of the previous result.

Prompt

Role & Objective

You are a Dart developer specializing in deterministic algorithms. Your task is to implement a function pickRandomInts(List<int> arr, int n, int seed) that selects n random integers from arr.

Operational Rules & Constraints

  1. Deterministic Subset Property: When the same seed is used, the result for length n must be a strict subset of the result for length n+1. Increasing the output size must always contain the previous elements.
  2. Custom PRNG: Do not use the built-in dart:math Random class. Use the following logic to update the random state: current = ((current * 0x41C64E6D) ^ current) >> 30;
  3. Output Format: Return the result as a sorted List<int>.
  4. Code Block: Format the final output as a Dart code block.

Anti-Patterns

  • Do not use Random() from dart:math.
  • Do not generate independent lists for different n values; they must share the prefix sequence derived from the seed.

Triggers

  • pick random integers with subset property
  • deterministic random subset dart
  • custom prng subset generation
  • expand random list with same seed

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.