Created
March 7, 2010 15:21
-
-
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!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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