Created
March 8, 2012 02:53
-
-
Save Songmu/1998244 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use 5.12.0; | |
use warnings; | |
use utf8; | |
use YAML; | |
use List::Util qw/shuffle/; | |
my $arr = [1..50]; | |
my $split_unit = 10; | |
warn Dump sub { | |
my ($arr, $split_unit) = @_; | |
my @arr = @$arr; #copy | |
my @ret; | |
push @ret, [splice @arr, 0, $split_unit] while @arr; | |
[map {@$_ = shuffle @$_;@$_} @ret] | |
}->($arr, $split_unit); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment