Answers for "gameboard grid"

0

gameboard grid

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()
Posted by: Guest on June-30-2021

Browse Popular Code Answers by Language