@a5rocks/

BitesizedMindlessComputationalscience

Python

What's bitesized? A cookie? What's mindless? A zombie cookie? What's computational science? I have no idea but sounds annoying.

fork
loading
Files
  • main.py

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.11554957625113449","path":"main.py","file":{"path":"main.py","content":{"asEncoding":{"base64":"IyBDb21wdXRlcyAiWm9tYmllIENvb2tpZSwiIGFzIEkgY2FsbCBpdAoKIyBTbyBzaW5jZSB6b21iaWUncyBlYXQgZXZlcnl0aGluZywgSSBmZWx0IHZlcnkgaW5zcGlyZWQKCmNsYXNzIENvb2tpZToKCWRlZiBfX2luaXRfXyhzZWxmKToKCQlwcmludCgnT24gYSBzcGVjaWFsIGRheS4uLiBBIGNvb2tpZSB3YXMgbWFkZS4nKQoJCmRlZiB6b21iaWZ5KGNvb2tpZSk6CglkZWYgbmV3X2VxKGEsIGIpOgoJCXJhaXNlIE5vdEltcGxlbWVudGVkRXJyb3IKCWNvb2tpZS5fX2VxX18gPSBuZXdfZXEuX19nZXRfXyhjb29raWUpCgpzcGVjaWFsX2Nvb2tpZSA9IENvb2tpZSgpCgpwcmludChzcGVjaWFsX2Nvb2tpZSA9PSAwKSAjIGxldCdzIGZpbmQgb3V0IQoKem9tYmlmeShDb29raWUpCgpub3JtYWxfY29va2llID0gQ29va2llKCkKCnByaW50KG5vcm1hbF9jb29raWUgPT0gMCkgIyBsZXQncyBmaW5kIG91dA=="},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Computes "Zombie Cookie," as I call it

# So since zombie's eat everything, I felt very inspired

class Cookie:
	def __init__(self):
		print('On a special day... A cookie was made.')
	
def zombify(cookie):
	def new_eq(a, b):
		raise NotImplementedError
	cookie.__eq__ = new_eq.__get__(cookie)

special_cookie = Cookie()

print(special_cookie == 0) # let's find out!

zombify(Cookie)

normal_cookie = Cookie()

print(normal_cookie == 0) # let's find out