源码说明
基于Python3+pygame制作而成,特别适合练手
![]() | 长按左侧二维码 2 秒 (非本号) |





def judge_move_up(chess_nums_temp):# 对棋盘的数字进行「行与列转置」,即原来在第2行第3列变为第3行第2列# zip: 实现# *chess_nums_temp对列表进行拆包chess_nums_temp = [list(row) for row in zip(*chess_nums_temp)]return judge_move_left(chess_nums_temp)def judge_move_down(chess_nums_temp):逻辑:判断能否向下移动, 也就是对于元素进行转置, 判断转置后的棋盘能否向右移动# 1.「行与列转置」chess_nums_temp = [list(row) for row in zip(*chess_nums_temp)]# 2. 判断是否可以向右移动return judge_move_right(chess_nums_temp)
![]() | 长按左侧二维码 2 秒 (非本号) |