Hacker News new | past | comments | ask | show | jobs | submit login

My algorithm for playing songs indefinitely in a random order:

1. let S = set of songs to be played

2. let N = number of songs

3. repeat until bored:

3.1. let R = set of last [N / 2] songs we played

3.2. pick a song at random from S \ R; play it

You may want to tweak step 3.2 to give higher probabilities of picking songs that haven't been played for longer.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: