Created
January 31, 2017 08:42
-
-
Save samcv/b34f9f7a9a5ee6c9b6da7b56cae47b3d to your computer and use it in GitHub Desktop.
This file contains 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
my %results; | |
for ^10 { | |
%results{$_}<bytes> = (1..10).pick; | |
} | |
say %results.perl; | |
say %results.keys.sort({ | |
my $c = %results{$^a}<bytes> cmp %results{$^b}<bytes>; | |
if $c { | |
$c; | |
} | |
else { | |
$^a.Int cmp $^b.Int; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment