"""
棋盘覆盖问题(NOIP2007初赛)第28问题动态演示程序
本程序需要python精灵模块支持,如果没有安装请用cmd打开管理员,输入
pip install sprites进行安装。
"""
from sprites import *
width,height = 400,400
screen = Screen()
screen.title('棋盘覆盖问题(NOIP2007初赛)第28问题动态演示程序李兴球')
ft = ('黑体',18,'bold')
ft2 = ('新宋体',12,'normal')
tom = Sprite(visible=False) # 负责画格子与显示标题信息的
tom.color('magenta')
tom.addy(250)
tom.write("棋盘覆盖问题(NOIP2007初赛)第28问题动态演示程序",align='center',font=ft)
tom.addy(-30)
tom.color('blue')
#tom.write("本程序由Python精灵模块开发by李兴球",align='center',font=ft2)
tom.home()
cors = tom.draw_grid2(4,4,50,50) # 画8x8,长宽为50的格子图
tom.shape('res/black.png')
# 下面是画黑白相间的格子
c = 0
for rows in cors:
index = c % 2
for xy in rows:
tom.goto(xy)
if index % 2 == 0 :tom.stamp()
index += 1
c = c + 1
qjack = Sprite('image-1.png',pos=(0,120))
jack0 = Sprite('L-1.png',pos=(120,120))
jack1 = Sprite('L-2.png',pos=(-120,-120))
jack1_2 = Sprite('L-2-2.png',pos=(-240,-120))
jack2 = Sprite('L-3.png',pos=(-120,120))
jack3 = Sprite('L-4.png',pos=(120,-120))
jackb0 = Sprite('L-1.png',pos=(240,120))
jackb1 = Sprite('L-2.png',pos=(-120,-24))
jackb1_2 = Sprite('L-2-2.png',pos=(-240,-120))
jackb2 = Sprite('L-3.png',pos=(-120,240))
jackb3 = Sprite('L-4.png',pos=(120,-240))
screen.mainloop()
