repl.it
@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
main.py
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