Advertisement
Guest User

Turtle Help V2

a guest
Feb 18th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. import turtle
  2.  
  3. y = 0 # if x is on top, line continues straight. If Y is on top, it zig zags
  4.  
  5. char = 33 # Starts as the first character to be printed, is incrimented in every loop
  6. for j in range(10): # number of rows
  7. x = -100 # if these are below for statement turtle stays on the line and continues 10 times
  8. for i in range(1, 11): # limits to ten characters
  9. turtle.penup()
  10. turtle.goto(x, y) #coordinates to start at
  11. turtle.pendown()
  12. turtle.write(chr(char)) # use the variable that we defined before the loop to print the correct character
  13. char += 1 # add one to go to the next character
  14. x += 30 #distance between
  15. y += 30 #distance between rows
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement