91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 0.01M
    文件類型: .py
    金幣: 1
    下載: 0 次
    發布日期: 2021-01-30
  • 語言: Python
  • 標簽: 五子棋??

資源簡介

兩兩對戰,體驗競技的樂趣,非常簡練的代碼

資源截圖

代碼片段和文件信息

from?tkinter?import?*
from?tkinter.messagebox?import?*
import?os

TAG_BLACK?=?“1“
TAG_EMPTY?=?“.“
TAG_WHITE?=?“0“
ROOT_DIR?=?os.path.abspath(os.path.dirname(os.path.abspath(__file__))?+?os.path.sep?+?“.“)


class?Chess(object):

????def?bf_save(self):

????????path?=?os.path.join(ROOT_DIR?“record.txt“)
????????file?=?open(path?“w“)
????????for?i?in?range(len(self.record)):
????????????x?y?=?self.record[i]
????????????file.write(“{}:?[{}?{}]\n“.format(“黑方“?if?i?%?2?==?0?else?“白方“?x?y))
????????file.close()

????def?init_matrix(self):
????????return?[[TAG_EMPTY?for?y?in?range(self.column)]?for?x?in?range(self.row)]

????def?__init__(self):
????????#############
????????#???param???#
????????#######################################
????????self.row?self.column?=?15?15
????????self.mesh

評論

共有 條評論