标签:
import random ops = {‘s‘ : 2, ‘j‘ : 1, ‘b‘ : 0} while True: x = raw_input(‘you>‘) ss = random.randint(0, 2) for t in ops.iteritems(): if t[1] == ss: print ‘pc:‘,t[0] rs = ops[x] - ss if rs == 1 or rs == -2: print ‘win‘ elif rs == 0: print ‘equal‘ else: print ‘lose‘
标签:
原文地址:http://www.cnblogs.com/iNeoWong/p/4734261.html