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"

In reply to (Golf) FLAMES by larryk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.