Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: Round robin processing

by rsFalse (Chaplain)
on Sep 10, 2019 at 09:36 UTC ( [id://11105941]=note: print w/replies, xml ) Need Help??


in reply to Re: Round robin processing
in thread Round robin processing

I tried a bit similar to 'slice.pl':

perl -wle 'use Data::Dumper; my @buckets; my $buckets = 4; @a = 1 .. 1 +4; push @buckets, [ grep defined, @a[ map { $_ * $buckets } 0 .. @a / + $buckets ] ] xor shift @a for 1 .. 1 + @a / $buckets; print Dumper( +@buckets )'
output:
Useless use of logical xor in void context at -e line 1. $VAR1 = [ 1, 5, 9, 13 ]; $VAR2 = [ 2, 6, 10, 14 ]; $VAR3 = [ 3, 7, 11 ]; $VAR4 = [ 4, 8, 12 ];
upd.Slightly changed a name of variable $bucket to $buckets.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-03-29 08:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found