Rockbox Development > Feature Ideas

A Better Random Play Routine

<< < (4/4)

LinusN:

--- Quote ---It was the latter here.  It seemed like after I had heard several songs by a certain artist I would be more likely to hear another song by that artist than another artist that I had not heard yet.  I played this game a few times: "Ive been hearing a lot of Led Zeppelin recently, lets see if I hear another Led Zeppelin before something by Tom Petty" (for example, since I have at least as many tracks by Tom Petty) and it seemed like it came true more often than not.

--- End quote ---
I must admit that I have had that exact same feeling myself numerous times. The thing is that a random shuffle doesn't mean that the files are evenly distributed in one specific shuffle...

pondlife:
Do the other random selections (database <Random> and Random Next Directory plugin) use the same code?  Or could they be less random?

pondlife

JdGordon:
random next dir just uses rand()%count so yes.. it probably sucks also :p

keuleJ:
Just out of interest:
Why do you use rand()%count and not something like rand()*count?
Doesnt rand() return someting between 0 and 1? Or is this a problem of the (not existing) floating point numbers?

LinusN:

--- Quote from: keuleJ on August 13, 2008, 08:33:43 AM ---Just out of interest:
Why do you use rand()%count and not something like rand()*count?
Doesnt rand() return someting between 0 and 1? Or is this a problem of the (not existing) floating point numbers?

--- End quote ---
The rand() function returns an integer number between 0 and RAND_MAX. It is a standard C function. And yes, floating point is out of the question.

Navigation

[0] Message Index

[*] Previous page

Go to full version