Talvieno

DEBUG LINE, CAPISCHE

Apr 21st, 2016
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. from Tools.Scripts.treesync import raw_input
  2.  
  3. classNames = []
  4. classes = []
  5. characters = []
  6. stats = []
  7. assignedClasses = []
  8.  
  9. classNames.append("COMBAT")
  10. classNames.append("SURVIVAL")
  11. classNames.append("SUPPORT")
  12. classNames.append("RECON")
  13. classes.append([[0, 9, 9, 9, 9, 9, 9, 9], [9, 9, 9, 0, 0, 0, 9, 9, 9]])
  14. classes.append([[9, 0, 0, 9, 9, 9, 9, 9], [0, 0, 9, 9, 9, 9, 9, 9, 9]])
  15. classes.append([[9, 9, 9, 0, 0, 0, 9, 9], [9, 9, 0, 9, 9, 9, 9, 9, 9]])
  16. classes.append([[9, 9, 9, 9, 9, 9, 0, 0], [9, 9, 9, 9, 9, 9, 9, 0, 0]])
  17.  
  18. with open('char_stats.txt', 'r') as fileNew:
  19. fileContents = fileNew.read().splitlines()
  20.  
  21. fileNew.close()
  22.  
  23. for i in range(0,len(fileContents), 4):
  24. characters.append(fileContents[i])
  25. temp = fileContents[i + 1]
  26. temp.split(",")
  27. temp2 = fileContents[i + 2]
  28. temp2.split(",")
  29. stats.append([[temp], [temp2]])
  30.  
  31. for i in characters:
  32. results = []
  33. best = -2
  34. bestCt = 0
  35. for q in classes:
  36. current = 0
  37. for q1 in range(0, 1):
  38. for q2 in range(0, 7):
  39. current += min(0, (classes[q][q1][q2] - stats[q][q1][q2]) * -1)
  40. if current > best:
  41. best = current
  42. bestCt = q
  43.  
  44. addClass = classNames[bestCt]
  45. for q in range(0, 3):
  46. if results[q] > best * .5 & q != bestCt:
  47. addClass += classNames[q]
  48.  
  49. assignedClasses.append(addClass)
  50.  
  51. print("wat, y u no work python, dis is debug line, capische")
  52.  
  53. for i in characters:
  54. print(characters[i] + ": " + assignedClasses[i])
  55.  
  56. raw_input('Press Enter to exit, because python closes too fast')
Advertisement
Add Comment
Please, Sign In to add comment