Skip to content

Instantly share code, notes, and snippets.

@kennydude
Created March 7, 2010 15:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kennydude/324407 to your computer and use it in GitHub Desktop.
Save kennydude/324407 to your computer and use it in GitHub Desktop.
It's that love game that loads of girls love to do. I recreated how it did that completly in Python!
import time
print "LOVE"
print "begin typing:"
_lover = raw_input()
lover = _lover.upper()
print "loves"
_loved = raw_input()
loved = _loved.upper()
print "Contacting cupids... please hold..."
print "---"
l = lover.count("L") + loved.count("L")
o = lover.count("O") + loved.count("O")
v = lover.count("V") + loved.count("V")
e = lover.count("E") + loved.count("E")
s = lover.count("S") + loved.count("S")
percent = "%i%i%i%i%i" % (l, o, v, e, s)
time.sleep(0.3)
print percent
#if percent != "":
while len(percent) != 2:
l = 0
g = False
newp = ""
for p in percent:
p = int(p)
if g == True:
newp += str(l + p)
l = p
g = True
percent = newp
time.sleep(0.3)
print percent
percent = int(percent)
if percent > 50:
print "Congradulations %s and %s you have a %i%% chance!" % (_lover, _loved, percent)
elif percent < 50:
print "Unfortunatly %s and %s you have a %i%% chance" % (_lover, _loved, percent)
elif percent == 50:
print "Wow! %s and %s you have a 50/50 (%i%%) chance!" % (_lover, _loved, percent)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment