Skip to content

Instantly share code, notes, and snippets.

@throwaway-30964
Created October 16, 2018 11:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save throwaway-30964/39aecda8ce4dcbae9297fd4b1d873d15 to your computer and use it in GitHub Desktop.
Save throwaway-30964/39aecda8ce4dcbae9297fd4b1d873d15 to your computer and use it in GitHub Desktop.
gen.p6
my \L = 3;
my %ng;
.comb.rotor(L.succ => -L).classify(*[^L].join, :as(*.tail(L).join), :into(%ng)) for words.rotor(1 => 1);
%ng{*}.=map(*.BagHash);
for ^10 {
my $name = gather {
(my $last = %ng.keys.grep(/^<:Lu>/).pick).take;
while $_ = %ng{$last} {
($last = .grab).substr(L.pred).take;
}
}.join;
say $name;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment