Create a combat function that takes the player's current health and the amount of damage recieved and returns the player's new health. Health can't be less than 0.
def combat(health, damage)
if health - damage > 0
return health - damage
else
return 0
end
end
def combat(health, damage)
health - damage > 0 ? health - damage : 0
end
def combat(health, damage)
[health-damage,0].max
end