SHARE
TWEET

Untitled

a guest Sep 13th, 2017 41 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import turtle as tt
  2. import random
  3.  
  4. words = ["apple", "happy", "surprise", "leagueoflegends", "overwatch", "maplestory", "battleground"]
  5. word = words[random.randint(0, 6)]
  6. count = 0
  7. print(word)
  8.  
  9. ui = tt.Pen()
  10. answer = tt.Pen()
  11. answer.hideturtle()
  12. answer.up()
  13.  
  14. #UI 그리기
  15. ui.speed(5)
  16. ui.up()
  17. ui.goto(-500, 350)
  18. ui.down()
  19. ui.fd(1000)
  20. ui.rt(90)
  21. ui.fd(700)
  22. ui.rt(90)
  23. ui.fd(1000)
  24. ui.rt(90)
  25. ui.fd(700)
  26. ui.up()
  27.  
  28. ui.goto(-150, -350)
  29. ui.seth(90)
  30. ui.down()
  31. ui.fd(400)
  32. ui.rt(90)
  33. ui.fd(150)
  34. ui.rt(90)
  35. ui.fd(150)
  36. ui.up()
  37.  
  38. for i in range(len(word)):
  39.     ui.seth(0)
  40.     ui.goto(-400 + i * 80, 250)
  41.     ui.down()
  42.     ui.fd(50)
  43.     ui.up()
  44.     ui.fd(30)
  45.  
  46. #게임 진행
  47. while(count < 6):
  48.         guess = input("알파벳 하나(여러개를 입력하면 첫번째 것만 인식합니다) : ")
  49.         for i in range(len(word)):
  50.                 if(guess[0] == word[i]):
  51.                         answer.goto(-400 * i, 260)
  52.                         answer.down()
  53.                         answer.write(guess[0])
  54.                         answer.up()
RAW Paste Data
Top