lundi, novembre 28, 2005

Lama Lama is Great

Meowmix Chatul wrote:

If there was a program written to describe today it would go something like this..

When xy00 hours, some part of experimental set up fails,
when fails, if Chatul gets frustrated,
then bang head into wall or some other sign of frustration
When y = even, laboratory equipment fails,
when y = odd, experimental equipment fails.
When 1715 hours arrives, allow tiny amount of success and bait the cat into
staying longer...

Meowmix's friend Lama Lama wrote in response:
How about this?

--

my $time = 0;
my $magicTime = 1715;
my $result = 0;
my $failure = -1;
my $n;

my %Chatul = ();

#initialization stuff here
.
.
.

while($result == $failure) {

$time++;

try {
$result = experiment($Chatul{thesisResearch}{data});
}
catch IOException with {
push(@{$Chatul{thesisResearch}}, "frustration");
bang(head(%Chatul));
}


$n = int(rand(2));

if (n % 2) {
throw IOException("Experimental equipment failure\n");
}
else {
throw IOException("Lab equipment failure\n");
}


if ($time == $magicTime) {
delude(grandeur($result));
$time = 0;
redo;
}
}

.
.
.