while(intruder){ fire() reload() } this.end() Protips: Pray to RNGesus. Or if you think it's too luck based, feel free to change the scenario yourself by substituting things for easier and/or less ranged things. Hey, don't look at me, you can modify the fields just as easily as I can. Second protip: Take down that damn tree before he(she?it?) does annoying stuff.