sjb.txt

  • 文件大小: 1.85KB
  • 文件类型: txt
  • 上传日期: 2025-06-17
  • 下载次数: 0

概要信息:

import random

class Player:
    def __init__(self):
        self.dict_gesture = {0: '剪刀', 1: '石头', 2: '布'}

    def gesture(self, num):
        return self.dict_gesture[num]

class AIPlayer(Player):
    play_data = []

    def ai_gesture(self):
        while True:
            computer = random.randint(0, 2)
            if len(self.play_data) >= 4:
                max_prob = max(self.play_data, key=self.play_data.count)
                if max_prob == '剪刀':
                    return '石头'
       ...

当前页面二维码

广告: