Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.44 KB | None | 0 0
  1. #************************#
  2. #* Jadday's Amazing *#
  3. #* Evolution Simulator *#
  4. #************************#
  5.  
  6. import random
  7.  
  8. print("The Evolution Starts Here")
  9.  
  10. numcs = 100
  11.  
  12. def generation1():
  13. global numcs
  14. profiles = []
  15. maxscore = 0
  16. minscore = 100
  17. x = 0
  18. for i in range(0,numcs):
  19. a = random.randint(0,75)
  20. b = random.randint(a,100)
  21. score = random.randint(a,b)
  22. name = [a,b]
  23. x = str(x)
  24. x = int(x)
  25. x = x + 1
  26.  
  27. if score > maxscore:
  28. maxscore = score
  29. score = str(score)
  30. best = score
  31. score = int(score)
  32.  
  33. if score < minscore:
  34. minscore = score
  35. score = str(score)
  36. worst = score
  37. score = int(score)
  38.  
  39. score = str(score)
  40. profile = score
  41. score = int(score)
  42. profiles.append(score)
  43. profiles = [int(x) for x in profiles]
  44. profiles.sort()
  45. print(profile)
  46. print("")
  47. print("")
  48. print("The best was:")
  49. print(best)
  50. print("")
  51. print("The worst was:")
  52. print(worst)
  53.  
  54. numcs = numcs // 2
  55.  
  56. templength = len(profiles)
  57. length = templength // 2
  58.  
  59. for x in range(0,length):
  60. del profiles[0]
  61.  
  62. print("")
  63. print(profiles)
  64.  
  65.  
  66.  
  67. def generation():
  68. global numcs
  69. profiles = []
  70. maxscore = 0
  71. minscore = 100
  72. x = 0
  73. for i in range(0,numcs):
  74. a = profiles[i]
  75. a = a / 2
  76. b = profiles[i]
  77. b = b * 2
  78. score = random.randint(a,b)
  79. name = [a,b]
  80. x = str(x)
  81. x = int(x)
  82. x = x + 1
  83.  
  84. if score > maxscore:
  85. maxscore = score
  86. score = str(score)
  87. best = score
  88. score = int(score)
  89.  
  90. if score < minscore:
  91. minscore = score
  92. score = str(score)
  93. worst = score
  94. score = int(score)
  95.  
  96. score = str(score)
  97. profile = score
  98. score = int(score)
  99. profiles.append(score)
  100. profiles = [int(x) for x in profiles]
  101. profiles.sort()
  102. print(profile)
  103. print("")
  104. print("")
  105. print("The best was:")
  106. print(best)
  107. print("")
  108. print("The worst was:")
  109. print(worst)
  110.  
  111. numcs = numcs // 2
  112.  
  113. templength = len(profiles)
  114. length = templength // 2
  115.  
  116. for x in range(0,length):
  117. del profiles[0]
  118.  
  119. print("")
  120. print(profiles)
  121.  
  122.  
  123.  
  124.  
  125. generation1()
  126. for x in range(0,6):
  127. generation()
  128. numcs = numcs // 2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement