! You are not logged in to Prodigits. Please register or login.

Shuffle logic??? - Page 2/2

Subject: Shuffle logic???
« <
edit.or 17.08.11 - 09:01pm
so the naive beta code would be logicaly like this: get total number of songs,store it in a variable totalsongs. make two array integers,played and..unplayed with the total index equal to totalsongs int. write song indexes to nonplayed. set random to choose from 1 to total songs pick from nonplayed. play it. defined time before the song end,which could be stored in variable as user preference, * +

edit.or 17.08.11 - 09:08pm
swap? the value of just played song in array played to the highest index of array and move the highest index to the place of just played song. this is pretty easy to do and i think i just realised the nonplayed array is not even required to be made with this system. decrease rand max value by one,so not to pick the top song. choose a random index again. play the song. no delays and playcount is * +

edit.or 17.08.11 - 09:09pm
determined accuretly,very simple and fast code but unfortunantly,i can't write the source here,no equal sine support,no newline,lack of most characters lol but i think you get the picture * +

srk_97 18.08.11 - 03:48pm
that was a really detailed explanation...got some idea about it.tnx tnx..u r really an EDITOR *

« <

Quick reply:

+ refresh
+ go to page 1-2
+ my page
+ functions
3 search
4 submit a reply
6 first page
+ bookmark
8 Tech&Computers Forum
9 Forum Index

Custom Search