Subject: I can do you one better. ^_^
Author:
Posted on: 2016-03-16 12:00:00 UTC

function shipfest()
{
//Set up our vic-- er, characters.
var innocentnewbie = "Larfen J. Stocke, esq";
var experienced
oldbie = "Desdendelle";

//Set up the location.
var theboard = new Array();

//And keep a count of how much wild shipping has been going on
var hours
ofshipping = 0;

// Cycle through the Board clock hour by hour
for (clock
time = 0; clocktime <= 24; clocktime ++)
{

//Des seems to be around from 7 am to 7pm
//So put him on
if (clocktime == 7)
{
the
board.push(experiencedoldbie);
}
//And take him off
else if (clock
time == 19)
{
for (boardcount = 0; boardcount < theboard.length; boardcount ++)
{
if (theboard[boardcount] == experiencedoldbie)
{
delete the
board[boardcount];
}
}
}
//Larfen is up from Board-midnight to about 5, then from 8pm to midnight.
//So two ons
if (clock
time == 0)
{
theboard.push(innocentnewbie);
}
else if (clocktime == 20)
{
the
board.push(innocentnewbie);
}
//And one off
else if (clock
time == 5)
{
for (boardcount = 0; boardcount < theboard.length; boardcount ++)
{
if (theboard[boardcount] == innocentnewbie)
{
delete the
board[boardcount];
}
}
}

//If both Des and Larfen are around, shipping can occur.

for (des
checker = 0; deschecker < theboard.length; deschecker ++)
{
if (the
board[deschecker] == experiencedoldbie)
{
for (larfenchecker = 0; larfenchecker < theboard.length; larfenchecker ++)
{
if (theboard[larfenchecker] == innocentnewbie)
{
hours
ofshipping += 1;
}
}
}
}



}
//And print out a popup of how much shipping has gone on.
window.alert(hours
of_shipping);
//The tragic conclusion:
//The love of Desdendelle and Larfen J. Stocke, esq is doomed
//because they're never around at the same time.

}

hS

(JavaScript, btw.)

Reply Return to messages