First PN.RND after P.SEED isn't random
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 222
- Forks
- 94
- PR merge metrics
- No merged PRs in 30d
Description
Please describe the bug.
The first call to PN.RND always returns the same value, after seeding the randomization via P.SEED with any seed. Subsequent calls of PN.RND are random.
I'm happy to look into this, but please let me if you have any pointers or I'm misunderstanding the feature.
Please include the hash displayed at startup and the release of the software (e.g. "Teletype v2.0.1 5f838c9")
Teletype v5.0.0 00FDFD2
What steps are required to reproduce the bug?
fill pattern 0 with values
P.SEED x
PN.RND 0
will always return the same value, regardless of x
Alternatively, filling 0 with values, and pattern 1 with seeds, then create a script like:
P.SEED PN.NEXT1
PN.NEXT 2 PN.RND 0
then trigger the script repeatedly to fill pattern 2 with the same value
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with P.SEED and PN.RND, then locate the implementations of those commands in the Teletype C source. Compare the first PN.RND result with later calls and with different seeds. Done means the first result varies appropriately with the seed and repeated script execution no longer produces the same value.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100