Menu
News
All News
Dungeons & Dragons
Level Up: Advanced 5th Edition
Pathfinder
Starfinder
Warhammer
2d20 System
Year Zero Engine
Industry News
Reviews
Dragon Reflections
White Dwarf Reflections
Columns
Weekly Digests
Weekly News Digest
Freebies, Sales & Bundles
RPG Print News
RPG Crowdfunding News
Game Content
ENterplanetary DimENsions
Mythological Figures
Opinion
Worlds of Design
Peregrine's Nest
RPG Evolution
Other Columns
From the Freelancing Frontline
Monster ENcyclopedia
WotC/TSR Alumni Look Back
4 Hours w/RSD (Ryan Dancey)
The Road to 3E (Jonathan Tweet)
Greenwood's Realms (Ed Greenwood)
Drawmij's TSR (Jim Ward)
Community
Forums & Topics
Forum List
Latest Posts
Forum list
*Dungeons & Dragons
Level Up: Advanced 5th Edition
D&D Older Editions, OSR, & D&D Variants
*TTRPGs General
*Pathfinder & Starfinder
EN Publishing
*Geek Talk & Media
Search forums
Chat/Discord
Resources
Wiki
Pages
Latest activity
Media
New media
New comments
Search media
Downloads
Latest reviews
Search resources
EN Publishing
Store
EN5ider
Adventures in ZEITGEIST
Awfully Cheerful Engine
What's OLD is NEW
Judge Dredd & The Worlds Of 2000AD
War of the Burning Sky
Level Up: Advanced 5E
Events & Releases
Upcoming Events
Private Events
Featured Events
Socials!
EN Publishing
Twitter
BlueSky
Facebook
Instagram
EN World
BlueSky
YouTube
Facebook
Twitter
Twitch
Podcast
Features
Top 5 RPGs Compiled Charts 2004-Present
Adventure Game Industry Market Research Summary (RPGs) V1.0
Ryan Dancey: Acquiring TSR
Q&A With Gary Gygax
D&D Rules FAQs
TSR, WotC, & Paizo: A Comparative History
D&D Pronunciation Guide
Million Dollar TTRPG Kickstarters
Tabletop RPG Podcast Hall of Fame
Eric Noah's Unofficial D&D 3rd Edition News
D&D in the Mainstream
D&D & RPG History
About Morrus
Log in
Register
What's new
Search
Search
Search titles only
By:
Forums & Topics
Forum List
Latest Posts
Forum list
*Dungeons & Dragons
Level Up: Advanced 5th Edition
D&D Older Editions, OSR, & D&D Variants
*TTRPGs General
*Pathfinder & Starfinder
EN Publishing
*Geek Talk & Media
Search forums
Chat/Discord
Menu
Log in
Register
Install the app
Install
Upgrade your account to a Community Supporter account and remove most of the site ads.
Community
General Tabletop Discussion
*Pathfinder & Starfinder
Listen up you little dice monkies
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Fieari" data-source="post: 1738245" data-attributes="member: 16221"><p>Well, actually, computers tend to use the time (in ms) in order to SEED a random number formula, not to generate the actual number. Interestingly enough, human beings are surprisingly good at timing even at that level, and when keyed to the clock like that there are people who can intuitivly use it to their advantage. Besides, with certain loops, each time the funciton would get called might occur on the same or a very VERY predictable pattern of numbers.</p><p></p><p>The actual method of "random" number generation varies from language to language, but I'm pretty sure that the C/C++ rand() function is basically the following line:</p><p></p><p>return next = (unsigned int)(((next * 1103515245 + 12345) / 65536) % 32768);</p><p></p><p>With next being set by srand(unsigned int), and is usually made the current time <em>at the start of the program</em>. After the program is loaded into memory, the rand function no longer cares about time and does its own thing. An interesting facet of this particular formula is that it wraps around.. that is to say, that when the multiplication of the previous "next" with 1103515245 gets to be too big, it wraps around to start at zero again, making a very interesting spread of numbers that doesn't repeat for a considerable period of time, by which time you likely won't notice anyways. All pseudo-random numbers will repeat EVENTUALLY, but better ones take longer to do it.</p></blockquote><p></p>
[QUOTE="Fieari, post: 1738245, member: 16221"] Well, actually, computers tend to use the time (in ms) in order to SEED a random number formula, not to generate the actual number. Interestingly enough, human beings are surprisingly good at timing even at that level, and when keyed to the clock like that there are people who can intuitivly use it to their advantage. Besides, with certain loops, each time the funciton would get called might occur on the same or a very VERY predictable pattern of numbers. The actual method of "random" number generation varies from language to language, but I'm pretty sure that the C/C++ rand() function is basically the following line: return next = (unsigned int)(((next * 1103515245 + 12345) / 65536) % 32768); With next being set by srand(unsigned int), and is usually made the current time [i]at the start of the program[/i]. After the program is loaded into memory, the rand function no longer cares about time and does its own thing. An interesting facet of this particular formula is that it wraps around.. that is to say, that when the multiplication of the previous "next" with 1103515245 gets to be too big, it wraps around to start at zero again, making a very interesting spread of numbers that doesn't repeat for a considerable period of time, by which time you likely won't notice anyways. All pseudo-random numbers will repeat EVENTUALLY, but better ones take longer to do it. [/QUOTE]
Insert quotes…
Verification
Post reply
Community
General Tabletop Discussion
*Pathfinder & Starfinder
Listen up you little dice monkies
Top