今天分享新书《跟小海龟学Python》的案例代码:国际象棋棋盘。
Python源代码:
from turtle import *
# 定义绘制填充正方形函数(左上角x、y坐标、边长、颜色)
def drawSquare(x, y, l, col):
color(col) # 设置颜色
penup
今天分享新书《跟小海龟学Python》的案例代码:国际象棋棋盘。
Python源代码:
from turtle import *
# 定义绘制填充正方形函数(左上角x、y坐标、边长、颜色)
def drawSquare(x, y, l, col):
color(col) # 设置颜色
penup