Updated again - Hooray - fixed it... now 185 chars.
Updated - fatal flaw with my code - I'm working on it.

Remember the primary school relationship analysis tool called FLAMES?

It goes something like this...

1. Start by writing out your name and the name of your (potential?) partner like so:

Buffy the Vampire Slayer LOVES larryk
2. See how many of each of the characters of "LOVES" are in both names (work out the number of leftover characters too for step 4 - N.B. ONLY counting letters, not spaces!):
L = 2 (1 in slayer, one in larryk) O = 0 V = 1 (1 in vampire) E = 3 (1 each in the, vampire and slayer) S = 1 (1 in slayer)
3. Now do the "magical" add-each-pair-of-numbers-to-produce-new-list-and-repeat operation on this list to reduce it to a percentage (i.e. the first number you come to which is lower than 101).
2 0 1 3 1 2+0=2 0+1=1 1+3=4 3+1=4 2 1 4 4 2+1=3 1+4=5 4+4=8 3 5 8 3+5=8 5+8=13 (special case: if(>9) separate digits) 8 1 3 8+1=9 1+3=4 9 4 = 94%
Update: There is an exception to this. In certain circumstances this can become a neverending loop e.g. 997 -> 1816 -> 997 ad infinitum. In these cases the result is always 100%. Short of coding around to find all dodgy sets and then hard-code to avoid them (sort of defeats the point of golfing it) I have decided to include an arbitrary limit to the number of cycles the op must perform before it is deemed to be "spiraling". You can pick your own number but I would advise not less than 12.

4. Take the number of leftover characters (n) and count through the word FLAMES (hence the name) to remove the nth character each time until there is one left (N.B. VERY IMPORTANT: each time you restart the count you must start at the position following the character you just removed - see below):

In this example the number of remaining chars is 20... F L A M E S 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 remove the L F A M E S 1 2 3 4 now start at A .. 20 remove the F A M E S 1 2 3 4 now start at A .. 17 18 19 20 remove the S A M E 1 2 3 now start at A .. 19 20 remove the M A E 1 now start at E .. 20 remove the A E this is the key
5. Index the key letter into the hash provided to determine the relationship type.
E = enemies

Golf challenge

Write a g subroutine (see my code below) in as few characters as you can to satisfy the above rules, taking 2 arguments - the two names to parse, and returning two values - the percentage (step 3) and the FLAMES character (step 4).

Caveats

FORE!!!

My code...

#!perl -l $ARGV[0] = 'Buffy the Vampire Slayer'; $ARGV[1] = 'larryk'; @l = qw/l o v e s/; @f = qw/f l a m e s/; %t = ( f => 'friends', l => 'lovers', a => 'arguers', m => 'marriage material', e => 'enemies', s => 'secret lovers' ); sub g { my@F=@f;($s=join'',@_)=~s/\W//g;@_=map$s=~s/$_//gi,@l;$r=length $s;do{@_=map{split'',$_[$_]+$_[$_+1]}0..$#_-1}until 101>join'', @_;$n=0;splice@F,$n=($r+$n-1)%@F,1 while@F>1;join('',@_),@F } print +(g(@ARGV))[0],"% ",$t{(g(@ARGV))[1]}; __END__ 94% enemies
   larryk                                          
perl -le "s,,reverse killer,e,y,rifle,lycra,,print"

Replies are listed 'Best First'.
Re: (Golf) FLAMES
by chipmunk (Parson) on Aug 30, 2001 at 20:14 UTC
    Whew, this was a tricky one! Here's my solution, at 150 characters:
    sub flames { $N="@_";(@F,$_,$l)=@f;for$l(@l){$_.=$N=~s/$l//gi+0 }$n=$N=~s/[a-z]//gi;s/.(?=(.))/$&+$1/ge,chop while $_>100;splice@F,$l=($l+$n-1)%@F,1 while$#F;$_+0,@F }
    We came up with exactly the same approach to counting off the letters in FLAMES.

    I included a +0 near the end of the sub, so that it will return '1' instead of '00001', for example.

    P.S. larryk, I'm very sorry things didn't work out for you and Buffy. Don't worry, I'm sure the right woman for you is out there somewhere!

      tricky - this one's off the scale. i'm v.impressed. i especially like the while$#F; which birdies the usual while@F>1; par 10.

      only shame is it probably won't be appreciated (read:++'ed) since few took any interest. good effort.

         larryk                                          
      perl -le "s,,reverse killer,e,y,rifle,lycra,,print"
Re: (Golf) FLAMES
by larryk (Friar) on Aug 30, 2001 at 11:03 UTC
    Update again - now correct
    Update - these are incorrect, I'll do them manually later (at work just now!)

    On request here are some test cases:

    Catherine Zeta Jones LOVES Michael Douglas = 29% friends Posh Spice LOVES David Beckham = 93% marriage material Melanie Griffith LOVES Antonio Banderas = 24% friends Britney Spears LOVES Justin Timberlake = 17% friends Madonna LOVES Guy Ritchie = 44% marriage material Sarah Michelle Gellar LOVES Freddie Prinze Jr. = 63% friends Monica Lewinsky LOVES Bill Clinton = 27% arguers

    Have fun

       larryk                                          
    perl -le "s,,reverse killer,e,y,rifle,lycra,,print"
Re: (Golf) FLAMES
by Anonymous Monk on Aug 30, 2001 at 13:29 UTC

    In your step 4 example to remove letters from FLAMES you first remove L then F then S then suddenly you have FAM left when it should be AME because you already took the F but not the E. Shouldn't you wind up with just E at the end rather than M. Throwing a print statement into your code shows it also arriving at M through a different (also incorrect) series of removals.

      You are absolutely correct. Apologies for such shoddy work. I have fixed the spec, my code and the test cases.
         larryk                                          
      perl -le "s,,reverse killer,e,y,rifle,lycra,,print"