fork download
  1. # simply put, what this does is let you select your priorities for rooms, and fill in which
  2. # champions you have.
  3. # then the logic finds the champion for each room who has the highest value, with the
  4. # least remaining value for all the other rooms.
  5. # My "database" is missing a lot of information for champions I don't have. If you can
  6. # fill in the blanks, PM me.
  7. # -- Carnou, Earth-228
  8.  
  9. # Special thanks to Zero and Zero's league, [GLC] The Corps, for helping me fill in the "database".
  10. # Currently missing champions: Luthor, Green Lantern, Joker, Deathstroke, Martian Manhunter,
  11. # Nightwing, TwoFace, Sinestro, Hawkgirl, Scarecrow, Constantine, Zatana, Stargirl
  12.  
  13. # we can fill out these rooms (training, bio_lab, steel, chips, armory, drone, research, power)
  14. # with more data as we get it.
  15. # for any champions not yet listed, it requires clicking on an assignee of each room, getting
  16. # the percentage they contribute, and adding it to each room.
  17.  
  18. ### This section is the "configuration" section
  19. # You list your order of preference for the rooms
  20. # And you list the champions that you have.
  21.  
  22. # Here, we fill out the list of champions that you actually have. As this
  23. # grows, we'll have more champions in each room than are necessarily in this list
  24. champions = [
  25. 'penguin',
  26. 'red hood',
  27. 'atom',
  28. 'vixen',
  29. 'batman',
  30. 'superman',
  31. 'harley quinn',
  32. 'aquaman',
  33. 'bane',
  34. 'black canary',
  35. 'robin',
  36. 'flash',
  37. 'red robin',
  38. 'poison ivy',
  39. 'deadshot',
  40. 'dr fate',
  41. 'wonder woman',
  42. 'catwoman',
  43. 'killer croc',
  44. 'black adam',
  45. 'mera',
  46. 'green arrow',
  47. 'captain cold',
  48. 'batgirl',
  49. 'twoface',
  50. ]
  51.  
  52. # Here, we set the priority FROM LOWEST TO HIGHEST
  53. # The algorithm will favor maximizing the rooms at the bottom
  54. # do not add or remove rooms, simply rearrange them
  55. priority = [
  56. 'training',
  57. 'training',
  58. 'armory',
  59. 'steel',
  60. 'steel',
  61. 'chips',
  62. 'chips',
  63. 'steel',
  64. 'steel',
  65. 'chips',
  66. 'chips',
  67. 'research',
  68. 'drone',
  69. 'drone',
  70. 'bio_lab',
  71. 'bio_lab',
  72. 'bio_lab',
  73. 'bio_lab',
  74. 'power',
  75. 'power',
  76. ]
  77.  
  78. ### This is "the database". It's not really a database, but it's where
  79. # we track champion data for each room
  80. # Once I get the complete database information, this will go in the
  81. # "don't touch!" section
  82. training = {
  83. 'aquaman': 30,
  84. 'atom': 15,
  85. 'bane': 30,
  86. 'batgirl': 30,
  87. 'batman': 30,
  88. 'black adam': 10,
  89. 'black canary': 30,
  90. 'captain cold': 10,
  91. 'catwoman': 15,
  92. 'cyborg': 20,
  93. 'deadshot': 20,
  94. 'dr fate': 20,
  95. 'flash': 30,
  96. 'green arrow': 15,
  97. 'green lantern': 20,
  98. 'harley quinn': 30,
  99. 'joker': 30,
  100. 'killer croc': 15,
  101. 'luthor': 30,
  102. 'mera': 10,
  103. 'penguin': 20,
  104. 'poison ivy': 20,
  105. 'raven': 20,
  106. 'red hood': 15,
  107. 'red robin': 30,
  108. 'robin': 30,
  109. 'scarecrow': 30,
  110. 'shazam': 20,
  111. 'stargirl': 20,
  112. 'superman': 30,
  113. 'twoface': 20,
  114. 'vixen': 15,
  115. 'wonder woman': 15,
  116. }
  117.  
  118. bio_lab = {
  119. 'aquaman': 30,
  120. 'atom': 15,
  121. 'bane': 30,
  122. 'batgirl': 20,
  123. 'batman': 20,
  124. 'black adam': 10,
  125. 'black canary': 30,
  126. 'captain cold': 10,
  127. 'catwoman': 10,
  128. 'cyborg': 20,
  129. 'deadshot': 20,
  130. 'dr fate': 20,
  131. 'flash': 30,
  132. 'green arrow': 10,
  133. 'green lantern': 30,
  134. 'harley quinn': 20,
  135. 'joker': 30,
  136. 'killer croc': 15,
  137. 'luthor': 20,
  138. 'mera': 15,
  139. 'penguin': 20,
  140. 'poison ivy': 30,
  141. 'raven': 30,
  142. 'red hood': 15,
  143. 'red robin': 20,
  144. 'robin': 30,
  145. 'scarecrow': 20,
  146. 'shazam': 30,
  147. 'stargirl': 20,
  148. 'superman': 30,
  149. 'twoface': 30,
  150. 'vixen': 15,
  151. 'wonder woman': 10,
  152. }
  153.  
  154. steel = {
  155. 'aquaman': 20,
  156. 'atom': 10,
  157. 'bane': 20,
  158. 'batgirl': 20,
  159. 'batman': 30,
  160. 'black adam': 15,
  161. 'black canary': 20,
  162. 'captain cold': 10,
  163. 'catwoman': 10,
  164. 'cyborg': 30,
  165. 'deadshot': 30,
  166. 'dr fate': 30,
  167. 'flash': 30,
  168. 'green arrow': 10,
  169. 'green lantern': 30,
  170. 'harley quinn': 20,
  171. 'joker': 20,
  172. 'killer croc': 10,
  173. 'luthor': 20,
  174. 'mera': 10,
  175. 'penguin': 20,
  176. 'poison ivy': 20,
  177. 'raven': 30,
  178. 'red hood': 10,
  179. 'red robin': 20,
  180. 'robin': 20,
  181. 'scarecrow': 20,
  182. 'shazam': 30,
  183. 'stargirl': 30,
  184. 'superman': 30,
  185. 'twoface': 20,
  186. 'vixen': 10,
  187. 'wonder woman': 15,
  188. }
  189.  
  190. chips = {
  191. 'aquaman': 20,
  192. 'atom': 10,
  193. 'bane': 20,
  194. 'batgirl': 30,
  195. 'batman': 30,
  196. 'black adam': 10,
  197. 'black canary': 20,
  198. 'captain cold': 10,
  199. 'catwoman': 15,
  200. 'cyborg': 30,
  201. 'deadshot': 20,
  202. 'dr fate': 20,
  203. 'flash': 20,
  204. 'green arrow': 15,
  205. 'green lantern': 20,
  206. 'harley quinn': 30,
  207. 'joker': 20,
  208. 'killer croc': 10,
  209. 'luthor': 30,
  210. 'mera': 10,
  211. 'penguin': 30,
  212. 'poison ivy': 20,
  213. 'raven': 20,
  214. 'red hood': 10,
  215. 'red robin': 30,
  216. 'robin': 30,
  217. 'scarecrow': 30,
  218. 'shazam': 20,
  219. 'stargirl': 20,
  220. 'superman': 20,
  221. 'twoface': 20,
  222. 'vixen': 10,
  223. 'wonder woman': 10,
  224. }
  225.  
  226. armory = {
  227. 'aquaman': 20,
  228. 'atom': 10,
  229. 'bane': 30,
  230. 'batgirl': 20,
  231. 'batman': 30,
  232. 'black adam': 15,
  233. 'black canary': 20,
  234. 'captain cold': 10,
  235. 'catwoman': 15,
  236. 'cyborg': 30,
  237. 'deadshot': 30,
  238. 'dr fate': 30,
  239. 'flash': 30,
  240. 'green arrow': 15,
  241. 'green lantern': 20,
  242. 'harley quinn': 20,
  243. 'joker': 30,
  244. 'killer croc': 15,
  245. 'luthor': 30,
  246. 'mera': 10,
  247. 'penguin': 20,
  248. 'poison ivy': 20,
  249. 'raven': 20,
  250. 'red hood': 10,
  251. 'red robin': 20,
  252. 'robin': 20,
  253. 'scarecrow': 20,
  254. 'shazam': 20,
  255. 'stargirl': 30,
  256. 'superman': 20,
  257. 'twoface': 30,
  258. 'vixen': 10,
  259. 'wonder woman': 10,
  260. }
  261.  
  262. drone = {
  263. 'aquaman': 20,
  264. 'atom': 15,
  265. 'bane': 20,
  266. 'batgirl': 30,
  267. 'batman': 30,
  268. 'black adam': 10,
  269. 'black canary': 20,
  270. 'catwoman': 10,
  271. 'captain cold': 10,
  272. 'cyborg': 30,
  273. 'deadshot': 20,
  274. 'dr fate': 30,
  275. 'flash': 20,
  276. 'green arrow': 15,
  277. 'green lantern': 30,
  278. 'harley quinn': 30,
  279. 'joker': 20,
  280. 'killer croc': 10,
  281. 'luthor': 30,
  282. 'mera': 10,
  283. 'penguin': 20,
  284. 'poison ivy': 20,
  285. 'raven': 20,
  286. 'red hood': 10,
  287. 'red robin': 30,
  288. 'robin': 30,
  289. 'scarecrow': 30,
  290. 'shazam': 30,
  291. 'stargirl': 20,
  292. 'superman': 20,
  293. 'twoface': 20,
  294. 'vixen': 15,
  295. 'wonder woman': 10,
  296. }
  297.  
  298. research = {
  299. 'aquaman': 30,
  300. 'atom': 15,
  301. 'bane': 30,
  302. 'batgirl': 30,
  303. 'batman': 30,
  304. 'black adam': 10,
  305. 'black canary': 20,
  306. 'catwoman': 10,
  307. 'captain cold': 10,
  308. 'cyborg': 20,
  309. 'deadshot': 20,
  310. 'dr fate': 20,
  311. 'flash': 30,
  312. 'green arrow': 10,
  313. 'green lantern': 20,
  314. 'harley quinn': 30,
  315. 'joker': 30,
  316. 'killer croc': 10,
  317. 'luthor': 30,
  318. 'mera': 15,
  319. 'penguin': 20,
  320. 'poison ivy': 30,
  321. 'raven': 20,
  322. 'red hood': 15,
  323. 'red robin': 30,
  324. 'robin': 30,
  325. 'scarecrow': 30,
  326. 'shazam': 20,
  327. 'stargirl': 20,
  328. 'superman': 20,
  329. 'twoface': 30,
  330. 'vixen': 10,
  331. 'wonder woman': 10,
  332. }
  333.  
  334. power = {
  335. 'aquaman': 30,
  336. 'atom': 10,
  337. 'bane': 30,
  338. 'batgirl': 20,
  339. 'batman': 30,
  340. 'black adam': 15,
  341. 'black canary': 30,
  342. 'captain cold': 10,
  343. 'catwoman': 10,
  344. 'cyborg': 30,
  345. 'deadshot': 20,
  346. 'dr fate': 20,
  347. 'flash': 30,
  348. 'green arrow': 10,
  349. 'green lantern': 30,
  350. 'harley quinn': 20,
  351. 'joker': 20,
  352. 'killer croc': 10,
  353. 'luthor': 20,
  354. 'mera': 10,
  355. 'penguin': 20,
  356. 'poison ivy': 20,
  357. 'raven': 30,
  358. 'red hood': 10,
  359. 'red robin': 20,
  360. 'robin': 30,
  361. 'scarecrow': 20,
  362. 'shazam': 30,
  363. 'stargirl': 30,
  364. 'superman': 30,
  365. 'twoface': 20,
  366. 'vixen': 10,
  367. 'wonder woman': 10,
  368. }
  369.  
  370. ### DO NOT MODIFY BEYOND THIS POINT
  371. ### (unless you like coding logic)
  372. rooms = {
  373. 'training': training,
  374. 'bio_lab': bio_lab,
  375. 'steel': steel,
  376. 'chips': chips,
  377. 'armory': armory,
  378. 'drone': drone,
  379. 'research': research,
  380. 'power': power,
  381. }
  382.  
  383. def calculate_value(champion):
  384. value = sum([rooms[room][champion] for room in priority])
  385. return value
  386.  
  387. while priority:
  388. room_name = priority.pop()
  389. score = -1
  390. champ = ""
  391. value = 999999
  392.  
  393. for champion in champions:
  394. champ_value = calculate_value(champion)
  395. if rooms[room_name][champion] > score:
  396. score = rooms[room_name][champion]
  397. champ = champion
  398. value = champ_value
  399. if rooms[room_name][champion] == score and champ_value < value:
  400. score = rooms[room_name][champion]
  401. champ = champion
  402. value = champ_value
  403.  
  404. champions.remove(champ)
  405. print(f"{champ} assigned to {room_name} with {score} points")
  406.  
  407.  
  408.  
Success #stdin #stdout 0.09s 14068KB
stdin
Standard input is empty
stdout
black canary assigned to power with 30 points
aquaman assigned to power with 30 points
poison ivy assigned to bio_lab with 30 points
twoface assigned to bio_lab with 30 points
bane assigned to bio_lab with 30 points
superman assigned to bio_lab with 30 points
dr fate assigned to drone with 30 points
harley quinn assigned to drone with 30 points
robin assigned to research with 30 points
penguin assigned to chips with 30 points
red robin assigned to chips with 30 points
deadshot assigned to steel with 30 points
flash assigned to steel with 30 points
batgirl assigned to chips with 30 points
batman assigned to chips with 30 points
black adam assigned to steel with 15 points
wonder woman assigned to steel with 15 points
catwoman assigned to armory with 15 points
red hood assigned to training with 15 points
atom assigned to training with 15 points