Random Number Generator – As Easy As 01, 10, 11..

Someone told me it is not a trivial task to make a good function generating a random number. What a fool I was to believe him! It turns out you can write down the function very easily. For example, in C++:

int getRandomNumber() {

   return 3; // proven to be random – obtained by throwing a dice

}

Not too complicated function, eh?

Advertisements
Published in: on Thursday, January 10, 2008 at 6:50 pm  Comments (2)  
Tags: , , , , , , , , ,

The URI to TrackBack this entry is: https://edgarsr.wordpress.com/2008/01/10/radom-number-generator-as-easy-as-01-10-11/trackback/

RSS feed for comments on this post.

2 CommentsLeave a comment

  1. http://xkcd.com/221/

  2. Nja, one source?


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: