[Gambas-user] A random sort of listview

Simonart Dominique simonart.dominique at ...11...
Mon Apr 13 15:50:58 CEST 2009


Hi Doriano,

 > I agree to everything you wrote.

I thought the same about what you wrote! :)

 >... Then, recalling to my mind
 >the way a person shuffles cards by hand, I tried to 
express another
 >algorithm, which in a certain way lets you to adjust the 
randomness: a
 >person can shuffle very well, or not. But, thinking over, 
my algorithm
 >does not fully respect this situation, because a true 
player shuffles
 >cards in chunks, by taking the last part of a deck and 
scattering it in
 >the middle of the remaining part... If someone wants to 
write a
 >realistic card games, perhaps could consider this.

It could be interesting to define a sort of "randomness 
evaluation", so we could compare several methods or evaluate 
the efficient limit to use.
For exemple, you take 1000 in your method but may be 500 
will be enough?
I will take a 10 cards' deck as illustration
I could think about 2 criters:
1) absolute difference between the initial and the final 
positions
2) absolute difference between 2 adjacent items

The first criter is not fair because all the places are not 
equivalent! the 5th position could not exceed a 5 difference 
but the 0th position could be 9! So we have to consider the 
serie 0-9 as a ring were 0 is next to 9, so the maximum 
difference is 5.
The same could be said about the second criter!

Now, I will stop to talk about that because it's no more 
Gambas related :(

cheers
Dominique Simonart





More information about the User mailing list