/**
 * This function updates the player's health based on the attack damage received.
 * If attack damage is greater than 50, player health is reduced by 50.
 * If attack damage is between 20 and 50, player health is reduced by half of the attack damage.
 * If attack damage is less than 20, player health remains the same.
 */
fun updatePlayerHealth(playerHealth: Int, attackDamage: Int): Int {

    var updatedHealth = playerHealth

    when {
        attackDamage > 50 -> updatedHealth -= 50
        attackDamage in 20..50 -> updatedHealth -= attackDamage / 2
    }

    return updatedHealth
}
/**
 * This function updates the player's health based on the attack damage received.
 * If attack damage is greater than 50, player health is reduced by 50.
 * If attack damage is between 20 and 50, player health is reduced by half of the attack damage.
 * If attack damage is less than 20, player health remains the same.
 */
fun updatePlayerHealth(playerHealth: Int, attackDamage: Int): Int {
/**
 * This function updates the player's health based on the attack damage received.
 * If attack damage is greater than 50, player health is reduced by 50.
 * If attack damage is between 20 and 50, player health is reduced by half of the attack damage.
 * If attack damage is less than 20, player health remains the same.
 */
fun updatePlayerHealth(playerHealth: Int, attackDamage: Int): Int {

    var updatedHealth = playerHealth

    when {
        attackDamage > 50 -> updatedHealth -= 50
        attackDamage in 20..50 -> updatedHealth -= attackDamage / 2
    }

    return updatedHealth
}