Guest User

Untitled

a guest
Dec 13th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.13 KB | None | 0 0
  1. from turtle import*
  2.  
  3. def tttDrawGrid():
  4.     ttt = Turtle()
  5.     ttt.speed(10)
  6.     ttt.width(10)
  7.     ttt.color('blue')
  8.     ttt.up()
  9.     ttt.right(180)
  10.     ttt.forward(150)
  11.     ttt.right(90)
  12.     ttt.forward(100)
  13.     ttt.right(90)
  14.     ttt.down()
  15.     ttt.forward(300)
  16.     ttt.up()
  17.     ttt.right(180)
  18.     ttt.forward(100)
  19.     ttt.right(90)
  20.     ttt.forward(100)
  21.     ttt.right(180)
  22.     ttt.down()
  23.     ttt.forward(300)
  24.     ttt.up()
  25.     ttt.right(180)
  26.     ttt.forward(100)
  27.     ttt.right(90)
  28.     ttt.forward(100)
  29.     ttt.right(180)
  30.     ttt.down()
  31.     ttt.forward(300)
  32.     ttt.up()
  33.     ttt.right(180)
  34.     ttt.forward(100)
  35.     ttt.right(90)
  36.     ttt.forward(100)
  37.     ttt.right(180)
  38.     ttt.down()
  39.     ttt.forward(300)
  40.    
  41. def tttDrawX():
  42.     t = Turtle()
  43.     t.up()
  44.     x = input("Choose a row between 0-2: ")
  45.     x = int(x)
  46.     x = x-1
  47.     y = input("Choose a coluumn between 0-2: ")
  48.     y = int(y)
  49.     t.goto(x*100-35,y*100-12)
  50.     t.down()
  51.     t.right(45)
  52.     t.forward(70*2**.5)
  53.     t.up()
  54.     t.left(130)
  55.     t.forward(70)
  56.     t.left(130)
  57.     t.down()
  58.     t.forward(70*2**.5)
  59.  
  60. tttDrawGrid()
  61. tttDrawX()
Add Comment
Please, Sign In to add comment