我写过一篇c++五子棋
现在又写了python
import copy
import time
from enum import IntEnum
import pygame
from pygame.locals import *
time = time.strftime("%Y-%m-%d %H:%M:%S")
version = str(time)
# 基础参数设置
square_size = 40 # 单格的宽度(不是格数!是为了方便绘制棋盘用的变量
chess_size = square_size // 2 - 2 # 棋子大小
web_broad = 15 # 棋盘格数+1(nxn)
map_w = web_broad * square_size # 棋盘长度
map_h = web_broad * square_size # 棋盘高度
info_w = 60 # 按钮界面宽度
button_w = 120 # 按钮长宽
button_h = 45
screen_w = map_w # 总窗口长宽
screen_h = map_h + info_w
# 地图绘制模块
class MAP_ENUM(IntEnum): # 用数字表示当前格的情况
be_empty = 0, # 无人下
player1 = 1, # 玩家一,执白
player2 = 2, # 玩家二,执黑
out_of_range = 3, # 出界
c