Name: Anonymous 2010-10-31 16:09
Happy Halloween
Have an unscientific and ultimately destructive day.
/prog/.Have an unscientific and ultimately destructive day.
/prog/.(or (trick treat))
use POSIX qw(strftime);
$date = strftime("%m%d , localtime);
if ( $date = "1031"){
trick() || treat()
};
(or 'trick 'treat)
(or trick treat)
treat >>= flip when trick ∘ isNothing
use Halloween qw(trick treat);
treat() || die(trick());
if(trick == true)
return trick;
else
return treat;
bool trick_or_treat(bool trick, bool treat)
{
if (trick == true)
return trick;
else
return treat;
}
void visit_house(struct house *h)
{
bool trick, treat;
if (knock(h->door) == K_OPEN) {
ask(&trick, &treat);
if (trick_or_treat(trick, treat) == treat)
collect_treats(house->host);
else
goto tp;
} else {
tp: tp_house(h);
}
}
return trick ?: treat;#include "halloween.h"
void visit_house(struct house *house, struct bag *loot)
{
int n_treats = 0;
if (knock(house->door) == K_OPEN)
n_treats = trick_or_treat(house->host);
if (!n_treats)
tp_house(house); /* Trick. */
else
do
add_to_loot(loot, collect_treat(house->host));
while (--n_treats);
}
treat() || trick() && treat()?
trick << treat?