$coin = int (rand(2 )) + 1; # Generate a random number between 1 and 2 print ( $coin == 1 ? "You tossed HEAD\n" : "You tossed TAIL\n" );