#! perl -w
#  Copyright 2012 Ken Takusagawa
#
#  This program is free software: you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation, either version 3 of the License, or
#  (at your option) any later version.
#  
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program.  If not, see <http://www.gnu.org/licenses/>.

sub rget {
    $_[rand @_];
}
@v=split //,(uc "aeiou");
$consonant=  "B C D F G J K L M N P R S T V Z";
#"B D G J L  M N R V Z"; #voiced
@c=split for ($consonant);
for$i(0..35){
    $x=$i%6;
    $y=($i-$x)/6;
    if($x==0){
        print"<tr>";
    }
    if(($x+$y) % 2){
        $n=rget @v;
    } else {
        $n=rget @c;
    }
    push @s,$n;
    print "<td> $n </td>";
    #print " $n ";
    if(5==$i%6){
        print "</tr>\n";
    }
}
$_="";
for$fl(0..1){
    for$y(0..5){
        for$x(0..5){
            if($y%2){
                $i=5-$x;
            } else {
                $i=$x;
            }
            $j=$y;
            if($fl){
                $j=$i;
                $i=$y;
            }
            $p=$s[6*$j+$i];
            $_ .= lc $p;
        }
        $_ .= "-";
    }
}
print "$_\n";
s/c/ch/g;
s/e-/eh-/g;
s/g([ie])/gh$1/g;
s/-$/\n/;
print;
