Perl just saved my ass. I've got to create a 400-word vocabulary in an alien language; it's due tomorrow, last day of school. I set up some rules for my language and then wrote a ten-minute perl job to create some very random syllables with something that resembles a logical consonant-vowel order. Worked perfectly and saved me four-plus hours of trouble. I'm going to bed now. :)

Replies are listed 'Best First'.
RE: Syllable Generator
by Anonymous Monk on May 29, 2000 at 03:05 UTC
    Hey, that reminds me of a cool little script I wrote. I had an assignment where I had to convert lots of numbers from decimal to binary, and each converstion had to be accompanied by tediously high amounts of working out. Being lazy, out came Perl and out came a nice script which printed out the working for each question. Woohoo! It was something like:

    20 / 2 = 10 rem 0 
    10 / 2 = 5 rem 0 
    5 / 2 = 2 rem 1
    2 / 2 = 1 rem 0
    1 / 2 = 0 rem 1 
    
    Therefore 20 in binary is 
    10100
    
      The functions pack and unpack can be of great help here, if you don't want to do a loop:
      my $number = "12345"; my $bin_number = unpack("B32", pack("N", $number)); print "$number in binary is $bin_number\n";
      Use a regex to get rid of leading zeroes.
RE: Syllable Generator
by PipTigger (Hermit) on Jun 08, 2000 at 10:50 UTC
    Can you post the code? I'd like to run it and see what kinda alien werds I can incorporate into my daily speech. =). TTFN & Shalom.

    -PipTigger
RE: Syllable Generator
by Anonymous Monk on May 31, 2000 at 00:52 UTC
    What class is that for?!?
      THREAD NECROMANCY The class was a high school seminar on communications, taught by the principal; it was six freakin years ago. I can't find the script, small wonder -- where all my work from before July of 2000 went is a damn good question. I'm now a perl hacker in and around new york city, and I've just reactivated my permonks account. Seeing how you all respond to necromancy OF EPIC PROPORTIONS.

        Ho ho! So you think we aren't paying attention? A dusty old thread like this?

        We see everywhere! We know everything! We never sleep!

        Welcome back, hope you enjoy the place.

        • another intruder with the mooring in the heart of the Perl