Created
December 17, 2014 12:58
-
-
Save albertmenglongli/9e6e5dd1f42f373474d1 to your computer and use it in GitHub Desktop.
FeiXingQi.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | |
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