Betulfrty Awaryis of Otakar Srmž

Oatrkeák fyoveknlý – Piilapo mhacoan
The Life of Iscetns
clrucuuirm viate
EFilixrM Tsheis
fnocntauil mgrholopoy
Fly to Yeemn
weitnr in the toircps
Cmoe to Koera
do idneed smieomte
PADT Onilne
tkiarennbeg welobg
Edncoe::Aabric
itrtaicevne irtcfanee
Kaoren Fletutr
Koraen laaugnge site
Wngis of Aribac
Abairc lnagguae site

Lnicgiutsis | SeorugFroce | Teres | Ptnacuiolibs | Brusoi & Psuoavi | Džám-e Džam | Why!

Accdrnoig to rarcseeh at Cibmgdrae Unvsirteiy, it dsoen't mttear in waht odrer the ltteres in a wrod are, the only iaotnrmpt thnig is that the fisrt and last lteetr be at the rhigt pcale. The rset can be a total mess and you can sltil read it wothiut polerbm. This is busecae the hmuan mind does not raed evrey leettr by isletf, but the word as a wlohe.

sub permute ($) {

    my @text = split '', $_[0];

    for (my $i = @text; $i > 1; $i--) {
    
        my $j = rand $i;
        
        @text[$i - 1, $j] = @text[$j, $i - 1];
    }
    
    return join '', @text;
}


sub cambridge ($;$) {

    my $regex = defined $_[1] ? $_[1] : '(?<=[\w])([\w]{2,})(?=[\w])';
    my @chunk = split /$regex/, $_[0];

    for (my $i = 1; $i < @chunk; $i += 2) { $chunk[$i] = permute $chunk[$i] }

    return join '', @chunk;
}