Last active
July 3, 2017 16:39
-
-
Save klrkdekira/5909e7693e1d40dda0e8fe5874b539ad to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TRUE = lambda a: (lambda b: a) | |
FALSE = lambda a: (lambda b: b) | |
NOT = lambda b: b(FALSE)(TRUE) | |
AND = lambda a: (lambda b: a(b)(FALSE)) | |
OR = lambda a: (lambda b: a(TRUE)(b)) | |
XOR = lambda a: (lambda b: a(NOT(b))(b)) | |
print('TRUE\t\t', TRUE(True)(False)) | |
print('FALSE\t\t', FALSE(True)(False)) | |
print('NOT TRUE\t', NOT(TRUE)(True)(False)) | |
print('NOT FALSE\t', NOT(FALSE)(True)(False)) | |
print('AND FALSE TRUE\t', AND(FALSE)(TRUE)(True)(False)) | |
print('AND FALSE FALSE\t', AND(FALSE)(FALSE)(True)(False)) | |
print('AND TRUE TRUE\t', AND(TRUE)(TRUE)(True)(False)) | |
print('OR TRUE TRUE\t', OR(TRUE)(TRUE)(True)(False)) | |
print('OR TRUE FALSE\t', OR(TRUE)(FALSE)(True)(False)) | |
print('OR FALSE TRUE\t', OR(FALSE)(TRUE)(True)(False)) | |
print('OR FALSE FALSE\t', OR(FALSE)(FALSE)(True)(False)) | |
print('XOR TRUE TRUE\t', XOR(TRUE)(TRUE)(True)(False)) | |
print('XOR TRUE FALSE\t', XOR(TRUE)(FALSE)(True)(False)) | |
print('XOR FALSE TRUE\t', XOR(FALSE)(TRUE)(True)(False)) | |
print('XOR FALSE FALSE\t', XOR(FALSE)(FALSE)(True)(False)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TRUE True | |
FALSE False | |
NOT TRUE False | |
NOT FALSE True | |
AND FALSE TRUE False | |
AND FALSE FALSE False | |
AND TRUE TRUE True | |
OR TRUE TRUE True | |
OR TRUE FALSE True | |
OR FALSE TRUE True | |
OR FALSE FALSE False | |
XOR TRUE TRUE False | |
XOR TRUE FALSE True | |
XOR FALSE TRUE True | |
XOR FALSE FALSE False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment