-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFLAMES_GAME.py
More file actions
57 lines (45 loc) · 1.18 KB
/
FLAMES_GAME.py
File metadata and controls
57 lines (45 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# -*- coding: utf-8 -*-
"""
Created on Sun Mar 21 08:14:01 2021
@author: DELL
"""
import string
def remove_matching_letter(l1,l2):
for i in range(len(l1)):
for j in range(len(l2)):
if l1[i]==l2[j]:
c=l1[i]
l1.remove(c)
l2.remove(c)
l=l1+['*']+l2
return[l, True]
l=l1+['*']+l2
return[l, False]
p1=input('Enter first person name: ')
p1=p1.lower()
p1=p1.replace(" ", "")
p2=input('Enter second person name: ')
p2=p2.lower()
p2=p2.replace(" ", "")
l1=list(p1)
l2=list(p2)
proceed='True'
while proceed:
ret_list=remove_matching_letter(l1, l2)
con_list=ret_list[0]
proceed=ret_list[1]
star_index=con_list.index('*')
l1=con_list[0:star_index]
l2=con_list[star_index+1:]
count=len(l1)+len(l2)
result=['Friends', 'Love', 'Affection', 'Marriage', 'Enemy', 'Siblings']
while(len(result)>1):
#modular counting
split_index=(count%len(result))-1
if split_index>=0:
right=result[split_index+1:]
left=result[:split_index]
result=right+left
else:
result=result[:len(result)-1]
print(result[0])