Created
September 7, 2014 09:15
-
-
Save masak/5f835f83efac7f68a2a9 to your computer and use it in GitHub Desktop.
Generate typing-friendly names
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
$ perl6 namer.p6 | |
ahay ahe akak ake ane apa bib bisu | |
bizi bowuw but buxu cub cug dirux dotu | |
dozi ehe epe gib gito guc guf hemaj | |
heya ibo ibogi ibos ico iqic iqo itoto | |
ivi iwiqi ixod ixot izu jek lam lap | |
lem len maj meka nak obic obif ocigi | |
ocod ocufo odu ogiv ogu osu ovuw owoxu | |
oxi oxo oxu ozi pala pel qig qiq | |
qoci qor ric riv rof rox rus soxo | |
sufu sug tos tuf tuq tuvi ubod uco | |
udoci ugo uqo urusi usi usu uti utu | |
uviqo uvo uvu uwi uxif uxo vit vof | |
wuduf xuf yenaj zucu |
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
my @vow = <a e i o u>; | |
my @cons = @( ("a".."z") (-) @vow ); | |
my @left = "qwertasdfgzxcvb".comb; | |
my @right = @( ("a".."z") (-) @left ); | |
my %rl = | |
(@left X=> "L"), | |
(@right X=> "R"), | |
; | |
my %names; | |
until %names == 100 { | |
my $pattern = Bool.pick ?? "CVCVCV" !! "VCVCVC"; | |
$pattern .= substr(0, (3..5).pick); | |
my $name = [~] $pattern.comb.map({ $_ eq "C" ?? @cons.roll !! @vow.roll }); | |
my $sides = join "", %rl{$name.comb}; | |
%names{$name}++ unless $sides ~~ /LL/ | /RR/; | |
} | |
my @sorted = %names.keys.sort; | |
while @sorted { | |
my @row = @sorted.splice(0, 8); | |
say @row.join("\t"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment