#!/usr/bin/perl my $wins = 0; my $lose = 0; my $goat; for (my $i=0;$i<1000000;$i++) { my $car = int rand(3); my $choice = int rand(3); do { $goat = int rand(3); } while (($goat != $car) && ($goat != $choice)); if ($choice != $car) {$wins++} else {$lose++}; } print "WINS = $wins!\nLOSE = $lose!\n";