So my girlfriend and her sisters were playing around with this iPhone app where you could enter two names and it would return a % compatibility match. I started playing with it too (no shame) and was trying to figure out how it worked. If you compared two exact strings, e.g., "John Doe" and "John Doe" it would return a somewhat random compatibility, but it would return the same compatibility every time. So it wasn't really "random".
Does anyone have any idea on how I could get a function to do the same in JavaScript? Here's my shell function:
function getCompatibility(name1, name2) {
// Lower case name1 and name2 and remove spaces
name1 = name1.replace(' ', '').toLowerCase();
name2 = name2.replace(' ', '').toLowerCase();
// Do some type of comparison to get a value between 0 and 100 back
// HELP ME HERE =]
}
getCompatibility('John Doe', 'John Doe'); // outputs 60% (or something)
getCompatibility('John Doe', 'John Doe'); // outputs 60% (same as above)
getCompatibility('John Resig', 'Angelina Jolie'); // outputs 90% (or something)