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‘
时间: 2024-10-16 07:28:23