#!/usr/bin/perl -w
# same program but just to show that you don't
# need variables that you can understand (they
# do mean something - can you guess what they actually say?)
$rogee_bakra = 0;
$chamak_kar = 1;
$saaraa = 3000;
foreach $badalnaa (0..1) {
  $jitnaa = 0;
  foreach (1..$saaraa) {
    @pardaa[0..2] = ($rogee_bakra, $rogee_bakra, $rogee_bakra);
    $maukaa = int(rand(3));
    $pardaa[$maukaa] = $chamak_kar;
    $chunee = int(rand(3));
    while (1) {
      $pardaa_utthaanaa = int(rand(3));
      if ($pardaa_utthaanaa == $chunee) {next};
      if ($pardaa[$pardaa_utthaanaa] == $chamak_kar) {next};
      last;
    }
    if ($badalnaa) {$chunee = 3 - $pardaa_utthaanaa - $chunee}
    if ($pardaa[$chunee] == $chamak_kar) {$jitnaa++;}
  }
  print "$jitnaa of $saaraa  =  " . int($jitnaa / $saaraa * 100 + 0.5) . "% for ";
  if ($badalnaa) {print "swapped\n"} else {print "not swapped\n"}
}
