Skip to content

Instantly share code, notes, and snippets.

@albertmenglongli
Created December 17, 2014 12:55
Show Gist options
  • Save albertmenglongli/d249fef8e583e8305503 to your computer and use it in GitHub Desktop.
Save albertmenglongli/d249fef8e583e8305503 to your computer and use it in GitHub Desktop.
FeiXingQi.py
import random
people=["wang","peng","duan","meng"]
winners=[];i=0
num=len(people)
while True:
if len(winners)>=num-1 or "exit" in winners:
print "game over!"
break
while True:
if people[i%num] in winners:
i=i+1
continue
input= raw_input()
if input == "exit":
winners.append("exit")
break
if input in people:
print input,"completed"
winners.append(input)
i=i-1
break
print people[i%num],
r = random.choice(range(1,7))
print r,
if r>=5:
print "*"
else:
print
i+=1
print "winners:"
for win in winners:
print ">>",win,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment