Advertisement
acclivity

pyTurtleChessboard

Dec 28th, 2021
1,084
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.35 KB | None | 0 0
  1. import turtle
  2.  
  3. t = turtle.Turtle()
  4. turtle.Screen().bgcolor("grey")
  5. t.up()
  6. t.shape("square")
  7. t.shapesize(4, 4)
  8. x, y = -280, 280
  9. colors = ["white", "black"]
  10. for row in range(8):
  11.     t.goto(x, y)
  12.     for h in range(8):
  13.         t.color(colors[(row + h) % 2])
  14.         t.stamp()
  15.         t.forward(80)
  16.     y -= 80
  17. t.hideturtle()
  18. turtle.exitonclick()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement