- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
stack = []
def stdout(x):
if x == "puts":
print(stack.pop())
else:
raise Exception("иди нахуй")
def stdin(x):
global stack
if x == "gets":
stack.append(input())
else:
raise Exception("иди нахуй")
math = {
"add": lambda: stack.append(float(stack.pop()) + float(stack.pop())),
"sub": lambda: stack.append((-float(stack.pop())) + float(stack.pop())),
"mul": lambda: stack.append(float(stack.pop()) * float(stack.pop())),
"div": lambda: stack.append(1 / float(stack.pop()) * float(stack.pop())),
}
def stack_commands(x):
global stack
if x == "swap":
stack[-1], stack[-2] = stack[-2:]
elif x == "drop":
stack.pop()
elif x == "dup":
stack.append(stack[-1])
else:
raise Exception("иди нахуй")
string = {
"concat": lambda: stack.append(str(stack.pop()) + str(stack.pop()))
}
commands = {
"comment": lambda x: x,
"push": lambda x: stack.append(x),
"stdout": stdout,
"stdin": stdin,
"math": lambda x: print(math[x]()),
"stack": stack_commands,
"string": lambda x: string[x]()
}
def do(x):
if '@' not in x:
raise Exception(x + " is not email.")
a, b = x.split('@')
b = b.split('.')[0]
commands[b](a)
def eval(s):
for i in s.lower().split():
do(i)
eval("""
[email protected]
[email protected] [email protected]
[email protected]
[email protected] [email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected] [email protected] [email protected]
""")
Follow us!