-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path36.py
36 lines (30 loc) · 1.22 KB
/
36.py
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
com=["게맛살", "구멍", "글라이더", "대롱", "더치페이", "롱다리", "리본", "멍게", "박쥐", "본네트", "빨대", "살구", "양심", "이빨", "이자", "자율", "주기", "쥐구멍", "차박", "트라이앵글"]
print("컴퓨터 : <시작>끝말잇기를 하자. 내가 먼저 말할게. 기차")
l={"기차", }
n=input("플레이어 : ")
a=list(n)
if a[0] != '차':
print("글자가 안 이어져. 내가 이겼다!<끝>")
else:
while True:
found_word=None
for word in com:
if word[0] == a[-1]:
found_word = word
break
if found_word is None:
print("컴퓨터 : 모르겠다. 내가 졌어.<끝>")
break
print("컴퓨터 :", found_word)
com.remove(found_word)
n=input("플레이어 : ")
a=list(n)
c=list(found_word)
if a[0] != c[-1]:
print("컴퓨터 : 글자가 안 이어져. 내가 이겼다!<끝>")
break
if n in l:
print("컴퓨터 : 아까 했던 말이야. 내가 이겼어!<끝>")
break
else:
l.add(n)