Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Round robin processing

by daxim (Curate)
on Sep 09, 2019 at 16:48 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11105893]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2024-04-23 16:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found