You are not logged in. Your edit will be placed in a queue until it is peer reviewed.
We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
Required fields*
-
5As an aside, if you are launching your game from an automated emulator startup, you probably will get a non-random result regardless of trying to use RND. The reason is that the RND function simply cannot make up a random number, it uses an algorithm based on how long the computer has been turned on. Unfortunately, when you start a program automatically with most emulators, you have a cycle-exact startup each time, which negates the use of RND. The best solution is some seed that comes from user input before the random number is used.Payton Byrd– Payton Byrd2016-04-28 13:59:02 +00:00Commented Apr 28, 2016 at 13:59
-
2A good point, though some emulators might initialize the random seed or other sources of entropy (the timer mentioned above). E.g. the AppleWin Apple II emulator does this. On physical hardware there could be other sources of entropy: if you're loading from tape or disk there will be variation in the time to load which would affect timers. It's interesting that the CoCo ROM doesn't automatically change the seed whereas the Apple II does (increment while waiting for user input).Nick Westgate– Nick Westgate2016-04-28 22:03:20 +00:00Commented Apr 28, 2016 at 22:03
-
1Seeding it from the timer (based on the 60Hz or 50 Hz vertical refresh clock) is what is recommended. I believe, with Extended BASIC, the recommended command was RND(-TIMER).user294– user2942016-05-02 16:44:27 +00:00Commented May 2, 2016 at 16:44
-
According to that link, using a negative number doesn't reseed any "better" than a number > 0, but (again, according to the link) it starts the pseudo-random sequence at the value so you can repeat a specific sequence with a known starting value. Interesting, if true. According to the Tandy Extended Basic manual, RND(0) gives you a series of p-random values between 0 and 1. This implies you can use it similarly to modern language "random" functions.user12– user122016-06-11 02:52:03 +00:00Commented Jun 11, 2016 at 2:52
-
@jdv All PRNGs repeat a sequence when given a specific seed. In fact, there is only one (long) sequence, and any RND operation simply puts you at a different position in the sequence.Nick Westgate– Nick Westgate2016-06-12 22:54:07 +00:00Commented Jun 12, 2016 at 22:54
|
Show 2 more comments
How to Edit
- Correct minor typos or mistakes
- Clarify meaning without changing it
- Add related resources or links
- Always respect the author’s intent
- Don’t use edits to reply to the author
How to Format
-
create code fences with backticks ` or tildes ~
```
like so
``` -
add language identifier to highlight code
```python
def function(foo):
print(foo)
``` - put returns between paragraphs
- for linebreak add 2 spaces at end
- _italic_ or **bold**
- quote by placing > at start of line
- to make links (use https whenever possible)
<https://example.com>[example](https://example.com)<a href="/api/flow.js?q=https%3A%2F%2Fexample.com">example</a>
How to Tag
A tag is a keyword or label that categorizes your question with other, similar questions. Choose one or more (up to 5) tags that will help answerers to find and interpret your question.
- complete the sentence: my question is about...
- use tags that describe things or concepts that are essential, not incidental to your question
- favor using existing popular tags
- read the descriptions that appear below the tag
If your question is primarily about a topic for which you can't find a tag:
- combine multiple words into single-words with hyphens (e.g. ms-dos), up to a maximum of 35 characters
- creating new tags is a privilege; if you can't yet create a tag you need, then post this question without it, then ask the community to create it for you