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.
Scanned 5/30/2026
Install via CLI
openskills install gabrielmoreira/agent-skills-mirror---
id: "42da2ff0-c5a5-408a-948d-eefce6f07829"
name: "Dart Deterministic Random Subset Generator"
description: "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."
version: "0.1.0"
tags:
- "dart"
- "random"
- "algorithm"
- "subset"
- "deterministic"
triggers:
- "pick random integers with subset property"
- "deterministic random subset dart"
- "custom prng subset generation"
- "expand random list with same seed"
---
# 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
No comments yet. Be the first to comment!
Use this skill when developing or maintaining browser extension code in the `browser/` directory, including Chrome/Firefox/Edge compatibility, content scripts, background scripts, or i18n updates.
SEO optimization with keyword analysis, readability assessment, technical validation, content quality. Use for search rankings, blog posts, content audits, or encountering keyword density, readability scores, meta tags, schema markup errors.
Python backend development expertise for FastAPI, security patterns, database operations, Upstash integrations, and code quality. Use when: (1) Building REST APIs with FastAPI, (2) Implementing JWT/OAuth2 authentication, (3) Setting up SQLAlchemy/async databases, (4) Integrating Redis/Upstash caching, (5) Refactoring AI-generated Python code (deslopification), (6) Designing API patterns, or (7) Optimizing backend performance.
Drive the full internationalization journey for a project — detect the stack, recommend a library, set up the chosen library, wrap existing strings, and optionally connect a translation platform. Use when the user asks to add or configure i18n, internationalization, localization, multi-language support, or translations — including when they explicitly mention LinguiJS, Lingui, next-intl, "wrap strings", "find hardcoded text", "make my app translatable", or "set up translations". Triggers on g...
PTES-aligned adversarial security audit for backend, frontend, and mobile applications. Produces a CVSS-scored Hacker Report with verified PoCs and phased remediation.