/**
 * In this exercise, you are a game developer working on a combat system for a game.
 * Your task is to implement the calculateDamage function which calculates the damage
 * the player will deal to an enemy based on their levels and health.
 *
 * The player's damage is calculated as follows:
 * - If the player's level is greater than the enemy's level, the damage will be equal to the player's level.
 * - If the player's level is equal to the enemy's level and the player's health is greater than 50,
 *   the damage will be equal to the player's level multiplied by 1.5.
 * - Otherwise, the damage will be equal to half of the player's level.
 *
 * Complete the code below to implement the calculateDamage function.
 */
fun calculateDamage(playerLevel: Int, enemyLevel: Int, playerHealth: Int): Double {

    return when {
        playerLevel > enemyLevel -> playerLevel.toDouble()
        playerLevel == enemyLevel && playerHealth > 50 -> playerLevel * 1.5
        else -> playerLevel / 2.0
    }
}
/**
 * In this exercise, you are a game developer working on a combat system for a game.
 * Your task is to implement the calculateDamage function which calculates the damage
 * the player will deal to an enemy based on their levels and health.
 *
 * The player's damage is calculated as follows:
 * - If the player's level is greater than the enemy's level, the damage will be equal to the player's level.
 * - If the player's level is equal to the enemy's level and the player's health is greater than 50,
 *   the damage will be equal to the player's level multiplied by 1.5.
 * - Otherwise, the damage will be equal to half of the player's level.
 *
 * Complete the code below to implement the calculateDamage function.
 */
fun calculateDamage(playerLevel: Int, enemyLevel: Int, playerHealth: Int): Double {
/**
 * In this exercise, you are a game developer working on a combat system for a game.
 * Your task is to implement the calculateDamage function which calculates the damage
 * the player will deal to an enemy based on their levels and health.
 *
 * The player's damage is calculated as follows:
 * - If the player's level is greater than the enemy's level, the damage will be equal to the player's level.
 * - If the player's level is equal to the enemy's level and the player's health is greater than 50,
 *   the damage will be equal to the player's level multiplied by 1.5.
 * - Otherwise, the damage will be equal to half of the player's level.
 *
 * Complete the code below to implement the calculateDamage function.
 */
fun calculateDamage(playerLevel: Int, enemyLevel: Int, playerHealth: Int): Double {

    return when {
        playerLevel > enemyLevel -> playerLevel.toDouble()
        playerLevel == enemyLevel && playerHealth > 50 -> playerLevel * 1.5
        else -> playerLevel / 2.0
    }
}