Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Round robin processing

by daxim (Curate)
on Sep 09, 2019 at 16:48 UTC ( #11105893=note: print w/replies, xml ) Need Help??


in reply to Round robin processing

use v5; use List::AllUtils qw(partition_by); my %h = partition_by { ($_ - 1) % 4 } 1..14 # (0 => [1, 5, 9, 13], 1 => [2, 6, 10, 14], 2 => [3, 7, 11], 3 => [4, +8, 12]) use v6; my %h = roundrobin((1..14).rotor(4, :partial)).kv # {0 => [1, 5, 9, 13], 1 => [2, 6, 10, 14], 2 => [3, 7, 11], 3 => [4, +8, 12]}

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2020-09-30 10:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If at first I donít succeed, I Ö










    Results (160 votes). Check out past polls.

    Notices?