2 Votes Vote

How to generate a random number from scratch

Posted by topdog 387 days ago Questions| random number scratch random All

How can a random number be generated from scratch, i.e without using any built-in features of the language / outside API that will help with the randomization process?

For example php has a rand() function and a seed function, and I'm sure java also has some similar stuff.

You can use built-in functions to get the current time etc, but the actual process of generating a random number has to be done by your code.

Any ideas?

Originally asked by: Click Upvote on Stack Overflow

Discuss Bury


Who Voted for this Question