Advertisement
Guest User

기억이미로.py

a guest
Jun 19th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.97 KB | None | 0 0
  1. import turtle
  2. import random
  3.  
  4. turtle.speed(0)
  5.  
  6. turtle.ht()
  7. turtle.up()
  8. turtle.setheading(0)
  9. turtle.goto(-256,256)
  10. turtle.down()
  11. turtle.forward(512)
  12. turtle.up()
  13. turtle.goto(-256,192)
  14. turtle.down()
  15. turtle.forward(512)
  16. turtle.up()
  17. turtle.goto(-256,128)
  18. turtle.down()
  19. turtle.forward(512)
  20. turtle.up()
  21. turtle.goto(-256,64)
  22. turtle.down()
  23. turtle.forward(512)
  24. turtle.up()
  25. turtle.goto(-256,0)
  26. turtle.down()
  27. turtle.forward(512)
  28. turtle.up()
  29. turtle.goto(-256,-64)
  30. turtle.down()
  31. turtle.forward(512)
  32. turtle.up()
  33. turtle.goto(-256,-128)
  34. turtle.down()
  35. turtle.forward(512)
  36. turtle.up()
  37. turtle.goto(-256,-192)
  38. turtle.down()
  39. turtle.forward(512)
  40. turtle.up()
  41. turtle.goto(-256,-256)
  42. turtle.down()
  43. turtle.forward(512)
  44. turtle.up()
  45. turtle.setheading(270)
  46. turtle.goto(-256,256)
  47. turtle.down()
  48. turtle.forward(512)
  49. turtle.up()
  50. turtle.goto(-192,256)
  51. turtle.down()
  52. turtle.forward(512)
  53. turtle.up()
  54. turtle.goto(-128,256)
  55. turtle.down()
  56. turtle.forward(512)
  57. turtle.up()
  58. turtle.goto(-64,256)
  59. turtle.down()
  60. turtle.forward(512)
  61. turtle.up()
  62. turtle.goto(0,256)
  63. turtle.down()
  64. turtle.forward(512)
  65. turtle.up()
  66. turtle.goto(64,256)
  67. turtle.down()
  68. turtle.forward(512)
  69. turtle.up()
  70. turtle.goto(128,256)
  71. turtle.down()
  72. turtle.forward(512)
  73. turtle.up()
  74. turtle.goto(192,256)
  75. turtle.down()
  76. turtle.forward(512)
  77. turtle.up()
  78. turtle.goto(256,256)
  79. turtle.down()
  80. turtle.forward(512)
  81.  
  82. x=1
  83. xp1=0
  84. xp2=0
  85. xp3=0
  86. xp4=0
  87. xp5=0
  88. xp6=0
  89. xp7=0
  90. xp8=0
  91. xp9=0
  92. xp10=0
  93. xp11=0
  94. xp12=0
  95. xp13=0
  96. xp14=0
  97. xp15=0
  98. xp16=0
  99. xp17=0
  100. xp18=0
  101. xp19=0
  102. xp20=0
  103. xp21=0
  104. xp22=0
  105. xp23=0
  106. xp24=0
  107. xp25=0
  108. xp26=0
  109. xp27=0
  110. xp28=0
  111. xp29=0
  112. xp30=0
  113. xp31=0
  114. xp32=0
  115. xp33=0
  116. xp34=0
  117. yp1=0
  118. yp2=0
  119. yp3=0
  120. yp4=0
  121. yp5=0
  122. yp6=0
  123. yp7=0
  124. yp8=0
  125. yp9=0
  126. yp10=0
  127. yp11=0
  128. yp12=0
  129. yp13=0
  130. yp14=0
  131. yp15=0
  132. yp16=0
  133. yp17=0
  134. yp18=0
  135. yp19=0
  136. yp20=0
  137. yp21=0
  138. yp22=0
  139. yp23=0
  140. yp24=0
  141. yp25=0
  142. yp26=0
  143. yp27=0
  144. yp28=0
  145. yp29=0
  146. yp30=0
  147. yp31=0
  148. yp32=0
  149. yp33=0
  150. yp34=0
  151. rep=int(random.choice([30,31,32,33,34]))
  152. while x<=rep:
  153.     xp=int(random.choice([192,128,64,0,-64,-128,-192]))
  154.     yp=int(random.choice([192,128,64,0,-64,-128,--192]))
  155.     zp=int(random.choice([0,180,270,90]))
  156.     turtle.up()
  157.     turtle.goto(xp,yp)
  158.     turtle.setheading(zp)
  159.     turtle.forward(64)
  160.     if zp==0:
  161.         xp=xp+32
  162.     elif zp==90:
  163.         yp=yp+32
  164.     elif zp==180:
  165.         xp=xp-32
  166.     else:
  167.         yp=yp-32
  168.     xp34=xp33
  169.     xp33=xp32
  170.     xp32=xp31
  171.     xp31=xp30
  172.     xp30=xp29
  173.     xp29=xp28
  174.     xp28=xp27
  175.     xp27=xp26
  176.     xp26=xp25
  177.     xp25=xp24
  178.     xp24=xp23
  179.     xp23=xp22
  180.     xp22=xp21
  181.     xp21=xp20
  182.     xp20=xp19
  183.     xp19=xp18
  184.     xp18=xp17
  185.     xp17=xp16
  186.     xp16=xp15
  187.     xp15=xp14
  188.     xp14=xp13
  189.     xp13=xp12
  190.     xp12=xp11
  191.     xp11=xp10
  192.     xp10=xp9
  193.     xp9=xp8
  194.     xp8=xp7
  195.     xp7=xp6
  196.     xp6=xp5
  197.     xp5=xp4
  198.     xp4=xp3
  199.     xp3=xp2
  200.     xp2=xp1
  201.     xp1=xp
  202.     yp34=yp33
  203.     yp33=yp32
  204.     yp32=yp31
  205.     yp31=yp30
  206.     yp30=yp29
  207.     yp29=yp28
  208.     yp28=yp27
  209.     yp27=yp26
  210.     yp26=yp25
  211.     yp25=yp24
  212.     yp24=yp23
  213.     yp23=yp22
  214.     yp22=yp21
  215.     yp21=yp20
  216.     yp20=yp19
  217.     yp19=yp18
  218.     yp18=yp17
  219.     yp17=yp16
  220.     yp16=yp15
  221.     yp15=yp14
  222.     yp14=yp13
  223.     yp13=yp12
  224.     yp12=yp11
  225.     yp11=yp10
  226.     yp10=yp9
  227.     yp9=yp8
  228.     yp8=yp7
  229.     yp7=yp6
  230.     yp6=yp5
  231.     yp5=yp4
  232.     yp4=yp3
  233.     yp3=yp2
  234.     yp2=yp1
  235.     yp1=yp
  236.     x=x+1
  237.    
  238. turtle.goto(-224,-224)
  239. turtle.setheading(45)
  240. turtle.st()
  241. def up():
  242.     turtle.setheading(90)
  243.     turtle.forward(64)
  244. turtle.onkeypress(up,"Up")
  245. turtle.listen()
  246.    
  247. turtle.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement