microsoft / microsoft/pxt

no function to set SEED for random number generator

Open
#10,326 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
2.3k
Forks
641
Avg merge
12h 4m
Merged PRs (30d)
57

Description

Makecode has no function/block to set SEED value used by random numbers generator. Current situation is that random number sequence repeats after each reset. That makes games predictable, etc. Could be a function added to allow set SEED to predefined value or just some random value (I understand this is a tricky, maybe some timer or sensor value could be used). JavaScript has function Math.random(), could be block for this function added to Makecode?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue does not name files, tests, or entry points. Start by locating MakeCode's random-number implementation and the block or API surface it exposes, then trace how reset affects the sequence. Done would require an agreed way to set or vary the seed and corresponding coverage for the resulting behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.