Author |
Topic: Random Shuffling (Read 862 times) |
|
hemanshu
Newbie


Gender: 
Posts: 14
|
 |
Random Shuffling
« on: Sep 19th, 2010, 7:43am » |
Quote Modify
|
How to do random card shuffling without using any inbuild random function
|
|
IP Logged |
|
|
|
towr
wu::riddles Moderator Uberpuzzler
    
 Some people are average, some are just mean.
Gender: 
Posts: 13730
|
 |
Re: Random Shuffling
« Reply #1 on: Sep 19th, 2010, 8:03am » |
Quote Modify
|
Well, you could make your own pseudo-random number generator. Or download a list of random bits from random.org and use those. Or take a deck of cards and shuffle them by hand, then scan the result
|
|
IP Logged |
Wikipedia, Google, Mathworld, Integer sequence DB
|
|
|
hemanshu
Newbie


Gender: 
Posts: 14
|
 |
Re: Random Shuffling
« Reply #2 on: Sep 19th, 2010, 9:48am » |
Quote Modify
|
I have to write a c/c++ function for this
|
|
IP Logged |
|
|
|
towr
wu::riddles Moderator Uberpuzzler
    
 Some people are average, some are just mean.
Gender: 
Posts: 13730
|
 |
Re: Random Shuffling
« Reply #3 on: Sep 19th, 2010, 11:37am » |
Quote Modify
|
C has a random function which you can use by doing #include <stdlib.h> If you want to compile code for a random number generator yourself, you can google for algorithms.
|
|
IP Logged |
Wikipedia, Google, Mathworld, Integer sequence DB
|
|
|
Grimbal
wu::riddles Moderator Uberpuzzler
    

Gender: 
Posts: 7527
|
 |
Re: Random Shuffling
« Reply #4 on: Sep 20th, 2010, 1:41pm » |
Quote Modify
|
There is this method. http://xkcd.com/221/ Just do it with 52 cards.
|
|
IP Logged |
|
|
|
towr
wu::riddles Moderator Uberpuzzler
    
 Some people are average, some are just mean.
Gender: 
Posts: 13730
|
 |
Re: Random Shuffling
« Reply #5 on: Sep 20th, 2010, 2:37pm » |
Quote Modify
|
That only works if you want to select a random card.
|
|
IP Logged |
Wikipedia, Google, Mathworld, Integer sequence DB
|
|
|
|