if(!(random(10) < 5)) // stop
#define chance(%1) ( %1 > random(100) ) // %1 = probability if(chance(50)) { // do stuff }