Sep 6, 2018 · 1 min read
So on my VM at home the first code took 43seconds so in the same ballpark. By using .roll instead of .pick in a loop (roll is like rolling a dice, you can get the same result twice) you get :
perl6 -e 'my @a = "a".."z".list; my @e = (@a.roll(8).join for ^1_000_000); say “P6: @e[0]”;'Which on my box again comes in at 4 seconds. Of course the realy trick is to make @e a lazy list with gather and take… but that’s cheating for what you want.
