From 574d25e32480105266f34967a05000ee0263c6d9 Mon Sep 17 00:00:00 2001 From: rhythmic-code <128319786+rhythmic-code@users.noreply.github.com> Date: Thu, 5 Oct 2023 12:14:01 +0530 Subject: [PATCH] Created FLAMES game Fixed issue #1899 --- Mini-Projects/Python/FLAMES game | 36 ++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Mini-Projects/Python/FLAMES game diff --git a/Mini-Projects/Python/FLAMES game b/Mini-Projects/Python/FLAMES game new file mode 100644 index 00000000..fea15a47 --- /dev/null +++ b/Mini-Projects/Python/FLAMES game @@ -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])