Skip to content

Commit

Permalink
Created FLAMES game
Browse files Browse the repository at this point in the history
Fixed issue Ishaan28malik#1899
  • Loading branch information
rhythmic-code authored Oct 5, 2023
1 parent 6e9e35e commit 574d25e
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions Mini-Projects/Python/FLAMES game
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
firstPerson = input()
secondPerson = input()

# creating an empty string to input only the non-common alphabets from both the names
flameString = ""

# Removing common characters from str1 which are also in str2
for i in range(len(firstPerson)):
if firstPerson[i] not in secondPerson:
flameString += firstPerson[i]

# Removing common characters from str2 which are also in str1
for i in range(len(secondPerson)):
if secondPerson[i] not in firstPerson:
flameString += secondPerson[i]

flamesCount = len(flameString) # Taking the length of the string after removing all the common alphabets


listOfAlpha = ['Frienship', 'Love', 'Affection', 'Marriage', 'Enemy', 'Siblings']

# F - Friendship
# L - Love
# A - Affection
# M - Marriage
# E - Enemy
# S - Siblings

# FLAMES game logic
while len(listOfAlpha) > 1:
index = flamesCount % len(listOfAlpha) - 1
if index < 0:
index = len(listOfAlpha) - 1
listOfAlpha = listOfAlpha[index + 1:] + listOfAlpha[:index]

print("Relationship:", listOfAlpha[0])

0 comments on commit 574d25e

Please sign in to comment.