DEV Community

Discussion on: Daily Challenge #28 - Kill the Monster!

Collapse
 
matrossuch profile image
Mat-R-Such

Python:

def killMonsters(h,m,dm):
    if m <= 3 :     print('hits: %d, damage: %d, health: %d' %(0,0,h))
    else:
        k= m // 4
        if k*dm >= h:    print('Hero Died')
        else: print('hits: %d, damage: %d, health: %d' %(k,k*dm,h-(k*dm)))