# simply put, what this does is let you select your priorities for rooms, and fill in which
# champions you have.
# then the logic finds the champion for each room who has the highest value, with the
# least remaining value for all the other rooms.
# My "database" is missing a lot of information for champions I don't have.  If you can
# fill in the blanks, PM me.
# -- Carnou, Earth-228

# Special thanks to Zero and Zero's league, [GLC] The Corps, for helping me fill in the "database".
# Currently missing champions: Martian Manhunter, Nightwing, Sinestro
# Constantine, Zatana,

# we can fill out these rooms (training, bio_lab, steel, chips, armory, drone, research, power)
# with more data as we get it.
# for any champions not yet listed, it requires clicking on an assignee of each room, getting 
# the percentage they contribute, and adding it to each room.

### This section is the "configuration" section
# You list your order of preference for the rooms
# And you list the champions that you have.

# Here, we fill out the list of champions that you actually have.  As this
# grows, we'll have more champions in each room than are necessarily in this list
champions = [
	'aquaman',
	'atom',
	'bane',
	'batgirl',
	'batman',
	'black adam',
	'black canary',
	'captain cold',
	'catwoman',
	'cyborg',
	'deadshot',
	'dr fate',
	'flash',
	'green arrow',
	'harley quinn',
	'joker',
	'killer croc',
	'luthor',
	'mera',
	'penguin',
	'poison ivy',
	'red hood',
	'red robin',
	'robin',
	'scarecrow',
	'shazam',
	'stargirl',
	'superman',
	'vixen',
	'wonder woman',
]

# Here, we set the priority FROM LOWEST TO HIGHEST
# The algorithm will favor maximizing the rooms at the bottom
# do not add or remove rooms, simply rearrange them
priority = [
    'training', 
    'training', 
    'armory', 
    'steel', 
    'steel', 
    'chips', 
    'chips', 
    'research', 
    'drone', 
    'drone', 
    'bio_lab', 
    'bio_lab', 
    'power',
    'power',
    ]
 
### This is "the database".  It's not really a database, but it's where
# we track champion data for each room
# Once I get the complete database information, this will go in the 
# "don't touch!" section
training = {
    'aquaman': 30,
    'atom': 15,
    'bane': 30,
    'batgirl': 30,
    'batman': 30,
    'black adam': 10,
    'black canary': 30,
    'captain cold': 10,
    'catwoman': 15,
    'cyborg': 20,
    'deadshot': 20,
    'deathstroke':30,
    'dr fate': 20,
    'flash': 30,
    'green arrow': 15,
    'green lantern': 20,
    'harley quinn': 30,
    'joker': 30,
    'killer croc': 15,
    'luthor': 30,
    'mera': 10,
    'penguin': 20,
    'poison ivy': 20,
    'raven': 20,
    'red hood': 15,
    'red robin': 30,
    'robin': 30, 
    'scarecrow': 30,
    'shazam': 20,
    'stargirl': 20,
    'superman': 30,
    'twoface': 20,
    'vixen': 15,
    'wonder woman': 15,
}

bio_lab = {
    'aquaman': 30,
    'atom': 15,
    'bane': 30,
    'batgirl': 20,
    'batman': 20,
    'black adam': 10,
    'black canary': 30,
    'captain cold': 10,
    'catwoman': 10,
    'cyborg': 20,
    'deadshot': 20,
    'deathstroke':30,
    'dr fate': 20,
    'flash': 30,
    'green arrow': 10,
    'green lantern': 30,
    'harley quinn': 20,
    'joker': 30,
    'killer croc': 15,
    'luthor': 20,
    'mera': 15,
    'penguin': 20,
    'poison ivy': 30,
    'raven': 30,
    'red hood': 15,
    'red robin': 20,
    'robin': 30, 
    'scarecrow': 20,
    'shazam': 30,
    'stargirl': 20,
    'superman': 30,
    'twoface': 30,
    'vixen': 15,
    'wonder woman': 10,
}

steel = {
    'aquaman': 20,
    'atom': 10,
    'bane': 20,
    'batgirl': 20,
    'batman': 30,
    'black adam': 15,
    'black canary': 20,
    'captain cold': 10,
    'catwoman': 10,
    'cyborg': 30,
    'deadshot': 30,
    'deathstroke':20,
    'dr fate': 30,
    'flash': 30,
    'green arrow': 10,
    'green lantern': 30,
    'harley quinn': 20,
    'joker': 20,
    'killer croc': 10,
    'luthor': 20,
    'mera': 10,
    'penguin': 20,
    'poison ivy': 20,
    'raven': 30,
    'red hood': 10,
    'red robin': 20,
    'robin': 20, 
    'scarecrow': 20,
    'shazam': 30,
    'stargirl': 30,
    'superman': 30,
    'twoface': 20,
    'vixen': 10,
    'wonder woman': 15,
}

chips = {
    'aquaman': 20,
    'atom': 10,
    'bane': 20,
    'batgirl': 30,
    'batman': 30,
    'black adam': 10,
    'black canary': 20,
    'captain cold': 10,
    'catwoman': 15,
    'cyborg': 30,
    'deadshot': 20,
    'deathstroke':30,
    'dr fate': 20,
    'flash': 20,
    'green arrow': 15,
    'green lantern': 20,
    'harley quinn': 30,
    'joker': 20,
    'killer croc': 10,
    'luthor': 30,
    'mera': 10,
    'penguin': 30,
    'poison ivy': 20,
    'raven': 20,
    'red hood': 10,
    'red robin': 30,
    'robin': 30, 
    'scarecrow': 30,
    'shazam': 20,
    'stargirl': 20,
    'superman': 20,
    'twoface': 20,
    'vixen': 10,
    'wonder woman': 10,
}

armory = {
    'aquaman': 20,
    'atom': 10,
    'bane': 30,
    'batgirl': 20,
    'batman': 30,
    'black adam': 15,
    'black canary': 20,
    'captain cold': 10,
    'catwoman': 15,
    'cyborg': 30,
    'deadshot': 30,
    'deathstroke':30,
    'dr fate': 30,
    'flash': 30,
    'green arrow': 15,
    'green lantern': 20,
    'harley quinn': 20,
    'joker': 30,
    'killer croc': 15,
    'luthor': 30,
    'mera': 10,
    'penguin': 20,
    'poison ivy': 20,
    'raven': 20,
    'red hood': 10,
    'red robin': 20,
    'robin': 20, 
    'scarecrow': 20,
    'shazam': 20,
    'stargirl': 30,
    'superman': 20,
    'twoface': 30,
    'vixen': 10,
    'wonder woman': 10,
}

drone = {
    'aquaman': 20,
    'atom': 15,
    'bane': 20,
    'batgirl': 30,
    'batman': 30,
    'black adam': 10,
    'black canary': 20,
    'catwoman': 10,
    'captain cold': 10,
    'cyborg': 30,
    'deadshot': 20,
    'deathstroke':30,
    'dr fate': 30,
    'flash': 20,
    'green arrow': 15,
    'green lantern': 30,
    'harley quinn': 30,
    'joker': 20,
    'killer croc': 10,
    'luthor': 30,
    'mera': 10,
    'penguin': 20,
    'poison ivy': 20,
    'raven': 20,
    'red hood': 10,
    'red robin': 30,
    'robin': 30, 
    'scarecrow': 30,
    'shazam': 30,
    'stargirl': 20,
    'superman': 20,
    'twoface': 20,
    'vixen': 15,
    'wonder woman': 10,
}

research = {
    'aquaman': 30,
    'atom': 15,
    'bane': 30,
    'batgirl': 30,
    'batman': 30,
    'black adam': 10,
    'black canary': 20,
    'catwoman': 10,
    'captain cold': 10,
    'cyborg': 20,
    'deadshot': 20,
    'deathstroke':20,
    'dr fate': 20,
    'flash': 30,
    'green arrow': 10,
    'green lantern': 20,
    'harley quinn': 30,
    'joker': 30,
    'killer croc': 10,
    'luthor': 30,
    'mera': 15,
    'penguin': 20,
    'poison ivy': 30,
    'raven': 20,
    'red hood': 15,
    'red robin': 30,
    'robin': 30, 
    'scarecrow': 30,
    'shazam': 20,
    'stargirl': 20,
    'superman': 20,
    'twoface': 30,
    'vixen': 10,
    'wonder woman': 10,
}

power = {
    'aquaman': 30,
    'atom': 10,
    'bane': 30,
    'batgirl': 20,
    'batman': 30,
    'black adam': 15,
    'black canary': 30,
    'captain cold': 10,
    'catwoman': 10,
    'cyborg': 30,
    'deadshot': 20,
    'deathstroke':20,
    'dr fate': 20,
    'flash': 30,
    'green arrow': 10,
    'green lantern': 30,
    'harley quinn': 20,
    'joker': 20,
    'killer croc': 10,
    'luthor': 20,
    'mera': 10,
    'penguin': 20,
    'poison ivy': 20,
    'raven': 30,
    'red hood': 10,
    'red robin': 20,
    'robin': 30, 
    'scarecrow': 20,
    'shazam': 30,
    'stargirl': 30,
    'superman': 30,
    'twoface': 20,
    'vixen': 10,
    'wonder woman': 10,
}

### DO NOT MODIFY BEYOND THIS POINT
### (unless you like coding logic)
rooms = {
    'training': training,
    'bio_lab': bio_lab,
    'steel': steel,
    'chips': chips,
    'armory': armory,
    'drone': drone,
    'research': research,
    'power': power,
}

def calculate_value(champion):
    value = sum([rooms[room][champion] for room in priority])
    return value

while priority:
    room_name = priority.pop()
    score = -1
    champ = ""
    value = 999999

    for champion in champions:
        champ_value = calculate_value(champion)
        if rooms[room_name][champion] > score:
            score = rooms[room_name][champion]
            champ = champion
            value = champ_value
        if rooms[room_name][champion] == score and champ_value < value:
            score = rooms[room_name][champion]
            champ = champion
            value = champ_value
            
    champions.remove(champ)
    print(f"{champ} assigned to {room_name} with {score} points")


