Created
January 27, 2016 02:41
-
-
Save LiaungYip/c3fa879bf64475a14a9b to your computer and use it in GitHub Desktop.
Ingress Portal Level Calculator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
full_deploy = [ | |
[0, 0, 0, 0, 0, 0, 0, 0], # Padding so agent levels are same as list indices | |
[1, 1, 1, 1, 1, 1, 1, 1], | |
[2, 2, 2, 2, 1, 1, 1, 1], | |
[3, 3, 3, 3, 2, 2, 2, 2], | |
[4, 4, 4, 4, 3, 3, 3, 3], | |
[5, 5, 4, 4, 4, 4, 3, 3], | |
[6, 6, 5, 5, 4, 4, 4, 4], | |
[7, 6, 6, 5, 5, 4, 4, 4], | |
[8, 7, 6, 6, 5, 5, 4, 4], | |
] | |
agents = [8,8,7] | |
deploy = [0, 0, 0, 0, 0, 0, 0, 0] | |
for agent_level in agents: | |
print "-- L%i agent begins --" % agent_level | |
limit = list ( full_deploy[agent_level] ) # Copy list | |
deploy.sort() | |
for n, resonator_level in enumerate(deploy): | |
if limit[0] > deploy[n]: | |
print "L%i agent replacing R%i with R%i" % (agent_level, deploy[n], limit[0]) | |
deploy[n] = limit.pop(0) | |
deploy.sort(reverse=True) | |
print deploy | |
print float(sum(deploy)) / len(deploy) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment