$atom scalar @shuffledOriginalAtoms 0) { my $index = int rand; $atom = $shuffledOriginalAtoms[$index]; # Check we haven't already changed it and it satisfies Lowenstein rule if { splice @shuffledOriginalAtoms, $index, 1; $atom = undef; } elsif { if (!$atom) { print Unable to satisfy Lowenstein's rule\\n; # Count the number