Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^2: Music shuffling

by Hue-Bond (Priest)
on Jul 09, 2008 at 07:18 UTC ( [id://696398]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    ## pseudocode
    my @list = shuffle get_tracks;
    my @list1 = @list[0..@list/2-1];
    ...
        shuffle @list1;
        shuffle @list2;
    }
    
  2. or download this
    ## pseudocode
    my @style_levels = (
        [ qw/noise/               ],
    ...
        my $next_style = ${ $style_levels[$next_index] }[ rand @{$style_le
    +vels[$next_index]} ];  ## choose a style of this level
        return get_song { style => $next_style };     ## pick some song of
    + this style
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://696398]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2024-04-23 18:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found