Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Happy Halloween

Name: Anonymous 2010-10-31 16:09

Happy Halloween /prog/.

Have an unscientific and ultimately destructive day.

Name: Anonymous 2010-10-31 16:12

Fuck

Name: Anonymous 2010-10-31 16:18

Only post in this thread if you aren't celebrating consumerism tonight.

Name: Anonymous 2010-10-31 16:24

Good Samhain

Name: Anonymous 2010-10-31 16:57

I'm looking for a magical ritual I could perform today, but I should have started researching earlier.

If I won't think of anything I'll just do the usual love or wealth spell or perhaps something to advance the gay agenda through magical means.

Name: Anonymous 2010-10-31 17:15

>>3

I'm not tonight. But I usually am.

Fuck your anti-consumerism bullshit. I'll consume and be vain and decadent as much as I want, so fuck your shit.

Name: Anonymous 2010-10-31 17:31

>>6
Okay, nice

Name: Anonymous 2010-10-31 17:35

(or (trick treat))

Name: Anonymous 2010-10-31 19:01


use POSIX qw(strftime);
$date = strftime("%m%d , localtime);
if ( $date = "1031"){
  trick() || treat()
  };

Name: Anonymous 2010-10-31 19:34

>>9
You try treat() only if trick()  succeeds?  I call bullshit on this whole Halloween shtick.

Name: Anonymous 2010-10-31 19:59

>>8
Do you trick the treat? Unary or there is unnecessary, btw.

Name: Anonymous 2010-11-01 2:48

(or 'trick 'treat)

Name: Anonymous 2010-11-01 3:13

>>12
(or '(trick treat))

Name: Anonymous 2010-11-01 4:55

What the hell?

(or trick treat)

Name: Anonymous 2010-11-01 8:33

treat >>= flip when trick ∘ isNothing

Name: Anonymous 2010-11-01 8:48

use Halloween qw(trick treat);
treat() || die(trick());

Name: Anonymous 2010-11-01 9:41

EASIEST ONE TO READ - CAN BE READ BY ANYBODY!

if(trick == true)
  return trick;
else
  return treat;

Name: Anonymous 2010-11-01 9:46

return trick | treat;

Name: Anonymous 2010-11-01 10:10

>>17
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);
    }
}

Name: Anonymous 2010-11-01 12:09

return trick ?: treat;

I love the binary ternary operator.

Name: Anonymous 2010-11-01 12:28

>>19
There's no reason to have two separate values for trick and treat; it's a single condition. If you don't get a treat, then you trick them. If you do get a treat, you leave them alone and go to the next house. Really, it ought to be called "treat or trick" because that's what's actually happening here.
Not to mention, your code is quite buggy and won't compile since you can't decide what to name your variables. (You would have noticed that before committing your code if you had a pre-commit hook that performs a test build!)

#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);
}

Name: Anonymous 2010-11-01 12:43

Wouldn't it rather be treat() || trick() && treat()?

Name: Anonymous 2010-11-01 12:53

>>22
while (!treat()) trick();

Name: Anonymous 2010-11-01 20:35

Typical aspie programmer thinking.
Do take note that in human communication, `or' is used to mean a choice of either one or the other, or what you subhumans refer to as `exclusive or'.

Thus the phrase should not be seen as describing an algorithm, but rather it asserts that
tricktreat

Name: Anonymous 2010-11-01 22:25

>>24
Typically, "or" is exclusive in natural language only in contexts where it would also be sensible to use the word "either." For example, if a waiter asks me if I would like cream or sugar, I am surely permitted to request both. Natural languages are ambiguous, and an intrinsic part of programming is to "fix" that ambiguity. (At least, of course, until someone constructs a perfect AI that is capable of discerning these sorts of things.)

Your narrow-minded comment only betrays inexperience, and you come off sounding very dull and boring by trying to "teach" us how language works. I'm not sure if you're trying to sound superior in some way by degrading others with suggestions that they are somehow less than human, but it's not working.

Name: Anonymous 2010-11-01 23:32

>>25
Lol, what kind of barbarian asks for cream *and* sugar?
Nevermind that many of the sad souls here would just answer "yes".

Name: Anonymous 2010-11-02 19:36

*knock knock*
trick << treat?

The sad story of the misinformed /prog/lodyte

Don't change these.
Name: Email:
Entire Thread Thread List