It's a Pokemon battle! Your task is to calculate the damage that a particular move would do using the following formula (not the actual one from the game):
damage = 50 * (attack / defense) * effectiveness
Effectiveness:
Attacks can be super effective, neutral, or not very effective depending on the matchup. For example, water would be super effective against fire, but not very effective against grass.
To prevent this challenge from being tedious, you'll only be dealing with four types: fire, water, grass, and electric. Here is the effectiveness of each matchup:
The function you must implement takes in:
calculate_damage("fire", "water", 100, 100) ➞ 25
calculate_damage("grass", "fire", 35, 5) ➞ 175
calculate_damage("electric", "fire", 100, 100) ➞ 50
Any type against itself is not very effective. Also, assume that the relationships between different types are symmetric (if A is super effective against B, then B is not very effective against A).