📜  游戏板网格 - 任何代码示例

📅  最后修改于: 2022-03-11 14:55:57.845000             🧑  作者: Mango

代码示例1
from graphics import *

win = GraphWin("Gameboard", 500, 500)
win.setCoords(0, 0, 10, 10)

def drawBoard(window):
    window.setBackground("black")
    rectangle = Rectangle(Point(1, 1), Point(9, 9))
    rectangle.setFill("white")
    rectangle.draw(window)

    for i in range(1, 10):
        Line(Point(1, i), Point(9, i)).draw(window)
    for x in range(1, 10):
        Line(Point(x, 1), Point(x, 9)).draw(window)

drawBoard(win)

win.getMouse()
win.close()