I couldn't check the full code but it seems you are initialising death_percentage to 0 and in the while loop u have >= 0...so it could be exiting without executing your loop.I think you need a <= 100 in the loop.