Code:
function areYouLucky(percent)
{
	if (random(1) < percent)
	{
		return(1);
	}
	return(0);
}



Always learn from history, to be sure you make the same mistakes again...