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

I HER U LYKE XNOR

Name: Anonymous 2009-01-09 3:20

hai guys, because I love you so much I made you a present:


def OR(a,b):
    """ Returns A + B
    """
    x = bool(a) or bool(b)
    return x

def AND(a,b):
    """ Returns A.B
    """
    x = bool(a) and bool(b)
    return x

def XOR(a,b):
    """ Returns A(XOR)B
    """
    if bool(a) and bool(b):
        x = False
    else:
        x = bool(a) or bool(b)
    return x

def INV(a):
    """ Returns -A
    """
    return XOR(a, True)

def NAND(a,b):
    """ Returns -(A.B)
    """
    return INV(AND(a,b))

def NOR(a,b):
    """ Returns -(A + B)
    """
    return INV(OR(a,b))

def XNOR(a,b):
    """ Returns -(A(XOR)B)
    """
    return INV(XOR(a,b))

Name: Anonymous 2009-01-09 4:06

Can I have the receipt? I'm going to return this and get something I actually need.

Name: Anonymous 2009-01-09 4:10

sorry, I 'made' it, no reciept, but feel free to turn it into something you actually need

Name: Anonymous 2009-01-09 4:24

10: assign value to x
20: return x

see anything redundant here?

Name: 2 2009-01-09 4:25

>>3
Thanks!

import operator as op

OR  = op.__or__
AND = op.__and__
XOR = op.__xor__
INV = op.__not__

NAND = lambda a, b: INV(AND(a, b))
NOR  = lambda a, b: INV(OR(a, b))
XNOR = lambda a, b: INV(XOR(a, b))

Name: Anonymous 2009-01-09 4:29

#define XOR(A, B) ((A && !B) || (!A && B))

That's the only one Sepples doesn't have.

Name: Anonymous 2009-01-09 4:30

>>4
You fail to grasp the awesome power of FAIL-SAFE ENTERPRISE REDUNDANT SYSTEMS

Name: Anonymous 2009-01-09 4:31

>>6
Now do it without reevaluating A and B.

Name: Anonymous 2009-01-09 4:32

the awesome thing about /prog/ is you can have your code optimized for free, you just have to look like a troll (obviously actual requests go unanswered)

Name: Anonymous 2009-01-09 4:40

>>6
#define XOR(A, B) (!(A) != !(B))

Name: Anonymous 2009-01-09 4:42

>>5
now write a bitwise version of each

Name: Anonymous 2009-01-09 4:48

Name: Anonymous 2009-01-09 4:58

>>9
I lol'd and then was very disturbed when I realized how true it is.

Name: Anonymous 2009-01-09 4:59

>>9
I lol'd and then was very disturbed when I realized how true it is.

Name: Anonymous 2009-01-09 5:04

>>9
Why you need these functions when you can write the operators  inline like A^B and B&C?

Name: Anonymous 2009-01-09 5:15

>>15
Who cares?

Name: Anonymous 2009-01-09 5:17

>>16
Functional programmers.

Name: Anonymous 2009-01-09 5:23

>>16
I do. Because >>1 described superfluous functions.

Name: Anonymous 2009-01-09 5:40

>>15,17,18
DON'T LOOK A GIFT HORSE IN THE MOUTH

Name: Anonymous 2009-01-09 5:44

>>19
the post of >>1 isn't a gift or present.
More apt comparison would be a Trojan horse since use of
superfluous functions is harmful to performance. they could be easily replaced by inline one-character bitwise operators.

Name: Anonymous 2009-01-09 5:46

Don't look a Trojan horse in the stomach.

Name: Anonymous 2009-01-09 6:44

>>21
I don't look at it. I defined it as "Trojan horse".

Name: Anonymous 2009-01-09 7:48

I care because you do

Name: Anonymous 2009-01-09 9:27

>>20
YOU ARE A FAGGOT!

Name: Anonymous 2009-01-09 9:40

>>24
I'm not homosexual. If you have some fixation with the term, i'm afraid my sexual preference will disappoint you. I prefer women.

Name: Anonymous 2009-01-09 9:48

>>25
FAGGOT!

Name: Anonymous 2009-01-09 9:53

>>26
Wrong. A homosexual would prefer man.
in >>25 i posted the opposite.
Do you believe i'm "faggot" for preferring women?

Name: Anonymous 2009-01-09 9:54

>>27
No, you're a faggot for BEING A FAGGOT!

Name: Anonymous 2009-01-09 9:54

>>27
Only men are homosexual now?

Name: Anonymous 2009-01-09 9:56

>>27
CONFIRMED LESBIAN

Name: Anonymous 2009-01-09 9:57

>>28 This is Circular logic: you are X because you are X.
>>29 homosexual women are properly called lesbians

Name: Anonymous 2009-01-09 10:01

>>31
ACCORDING TO YOUR PRECIOUS FUCKING WIKIPEDIA, YOU'RE WRONG FAGGOT!

http://en.wikipedia.org/wiki/Homosexuality

Name: Anonymous 2009-01-09 10:11

>>32
You didn't read the article at all.
http://en.wikipedia.org/wiki/Homosexuality
"The word gay generally refers to male homosexuality, but is sometimes used in a broader sense to refer to homosexuality in general. In the context of sexuality, the word lesbian denotes female homosexuality."

Name: Anonymous 2009-01-09 13:32

and this, my fellow Anonymous is why you have not yet learned the way of the program.

You need to firstly understand that there is a general case, and then a stop case for any iterative or recursive thought.

Name: Anonymous 2009-01-09 13:36

>>33
but is sometimes used in a broader sense to refer to homosexuality in general.

Name: Anonymous 2009-01-09 14:05

>>35
It indeed does. However to be specific you need to mention the gender-dependent version, which is lesbian.

Name: Anonymous 2009-01-09 14:07

>>36
You have to learn to understand.

Name: Anonymous 2009-01-09 14:26

>>37
I understand what homosexuality refers to(same gender relationships), but i can't understand how can I be a lesbian(homosexual women as >>29 describes ) when i'm Male.

Name: Anonymous 2009-01-09 14:36

>>38
i'm Male
[citation needed]

Name: Anonymous 2009-01-09 14:36

>>38
Its perfectly obvious how you can be a male lesbian; if you don't understand, then that shows your lack of comprehension.

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