画国际象棋盘

import turtle
for i in range(8): 
 for j in range(8):
  turtle.forward(37.5)
  if j % 2 == 0:
 
   if i % 2 ==0:
    turtle.begin_fill()
    for s in range(4):
     turtle.left(90)
     turtle.forward(37.5)
    turtle.end_fill()
   else :
    turtle.begin_fill()
    for s in range(4):
     turtle.right(90)
     turtle.forward(37.5)
    turtle.end_fill()
 if i % 2 == 0:
  turtle.left(90)
  turtle.forward(37.5)
  turtle.left(90)
 else:
  turtle.right(90)
  turtle.forward(37.5)
  turtle.right(90)
turtle.forward(300)
turtle.done()

 

上一篇:JSP中的两种重定向


下一篇:Total Commander SFTP路径斜杠和反斜杠的研究