#esoteric-python

1 messages · Page 141 of 1

floral meteor
#

you could play around with the bytecode of everything during runtime and translate all the double pos and neg operations to increments and decrements respectively

#

someone made mutable bytes

#

so do that with the bytecode of the top frame

fleet bridge
#
x = something
y = -x
z = -y

it will decrement x, it isnt obvious for user

finite blaze
#

i would probably need to check if it isn't in quotation marks

floral meteor
finite blaze
#

like "i++"

floral meteor
#

we aren't interpreting a string, we are interpreting python code

#

i.e. modifying the runtime environment from within the runtime environment

fleet bridge
floral meteor
#

we only need to modify the present level frame

floral meteor
# finite blaze like `"i++"`

what you're thinking of is probably just an interpreter for an entirely different language, which is easy but tedious

fleet bridge
#

also we can implement postfix dec/increment in this way: x++ XXX
in bytecode it will be equal to x + (+XXX), but we can replace something + (+XXX) with custom increment call
(XXX - is reserved name in this implementation)
(this is ugly)

severe canyon
#

!e

class Int():
    def __init__(s,v):s.v = v
    __pos__ = lambda s:Int(s.v+1)
    __str__ = lambda s:f'{s.v}'
a = Int(2)
print(+a)
night quarryBOT
#

@severe canyon :white_check_mark: Your eval job has completed with return code 0.

3
severe canyon
#

lol

#

smthing like this xD

floral meteor
#

lol, now make it work with two to increment it once, and a single plus does nothing\

severe canyon
#

mhm, ill do that tomorrow

fleet bridge
#

there was similar implementation:
+i returns i+0.5
+f returns rounded f+0.5
(f - float, i - int)

floral meteor
#

make a flag as optional input to the __init__

fleet bridge
#

ints is too simple, make it smarter!

#

i have implemented bitsets (arrays of bits) based on python int (it is possible, because python ints has no limit)

severe canyon
night quarryBOT
#

@severe canyon :white_check_mark: Your eval job has completed with return code 0.

001 | 2
002 | 3
severe canyon
#

the worst solution ever

fleet bridge
#

what should i return, if i dont know how to compare object with self?
False or NotImplemented?

#

🥳
ints with dicts!

floral meteor
#

that script theoretically should work

#

someone broke python.

severe canyon
#

sure it wasnt you?

floral meteor
#

nope

#

!e ```py
class Int(int):
def init(self, n, flag=0):
super().init(n)
self.flag=flag
def pos(self):
if self.flag:
self.flag=0
return Int(self+1, 0)
self.flag=1
return self
def neg(self):
if self.flag:
self.flag = 0
return Int(self-1, 0)
return Int(0-self, 1)

import ctypes
p = ctypes.py_object.from_address(id(globals())+8)
class flogbals(p.value):
def setitem(self, item, value):
if type(value)in(int,Int):
value = Int(value, 0)
dict.update(self,{item:value})
p.value = flogbals

a = 1
print(++a, a)
print(--a, a)

night quarryBOT
#

@floral meteor :x: Your eval job has completed with return code 139 (SIGSEGV).

001 | Traceback (most recent call last):
002 |   File "<string>", line 26, in <module>
003 |   File "<string>", line 22, in __setitem__
004 | TypeError: int() can't convert non-string with explicit base
fleet bridge
floral meteor
#

ok it happens before the error i found

#

the last underscore in __name__ is blue

#

it's freaking me out

#

the syntax highlight is brok

floral meteor
#

the last underscore is thinner than the others

fleet bridge
#

why second file is markdown (.md), but first - .rb ?

floral meteor
#

it probably autodetected and detected wrong

fleet bridge
#

class str(Sequence[str]):

the most weird place in typeshed
str is subclass of Sequence[str]

#

!e

class Dict(dict):
    ...

d = Dict({'a': 1, 'b': 2})
print(d)
assert type(d) is Dict
print(d.__dict__)
assert type(d.__dict__) is dict
d.__dict__.update(d)
print(d.__dict__)
night quarryBOT
#

@fleet bridge :white_check_mark: Your eval job has completed with return code 0.

001 | {'a': 1, 'b': 2}
002 | {}
003 | {'a': 1, 'b': 2}
fleet bridge
#

dict with dict, you can use dict while using dict

severe canyon
earnest wing
#

lol, d.__dict__.update(d) as a one-liner to create a frozen dotteddict

fleet bridge
#

it is possible to set .__dict__ to some value

#

and i can set d.__dict__ to d

#

and d.__dict__ will be syncronized with d

floral meteor
#

should I count scrolling up and seeing this as a bug?

#

if you don't scroll, there's nothing to see...

#

but if you do, the ghost of the startup sequence can be seen

fleet bridge
#
>>> class D(dict): ...
...
>>> d = D()
>>> d.__dict__
{}
>>> d.__dict__ = d
>>> d.__dict__ is d
True
>>> d[1] = 2
>>> d.a = 3
>>> d
{1: 2, 'a': 3}

i think it is the most efficient implementation of namespace

#
>>> class X: ...
...
>>> x1, x2 = X(), X()
>>> x1.__dict__ = x2.__dict__
>>> x1.a = 5
>>> x2.a
5
severe canyon
#

I'm sure there is a flag or smthing that disables scrolling

earnest wing
#

Wow okay it's really that simple

class attrdict(dict):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.__dict__ = self
floral meteor
#

wholesome error message

#

completely obfuscating the original line that raised the error

fleet bridge
#

миша

floral meteor
#

"[Previous line repeated 1 more time]"

floral meteor
#

I tried making itertools.product, it couldn't be brokener

#

maybe I've lost my grip on programming

#

!e okay i finally got it to work ```py
def product(*iters,repeat=1,_vars=()):
iters=[*iters]*repeat
if not iters:return()
if len(iters)==1:
for e in iters[0]:
yield _vars+(e,)
else:
for e in iters.pop(0):
yield (*product(*iters,_vars=_vars+(e,)),)
print(*product(range(3),[3,2,3]))

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

((0, 3), (0, 2), (0, 3)) ((1, 3), (1, 2), (1, 3)) ((2, 3), (2, 2), (2, 3))
floral meteor
#

wait that doesn't look right

#

!e this is getting worse ```py
def product(*iters,repeat=1,_vars=(),_fr=None):
if _fr is None:_fr=[]
iters=[*iters]*repeat
if not iters:return _vars
if len(iters)==1:
for e in iters[0]:
_fr += [_vars+(e,)]
else:
for e in iters.pop(0):
*product(*iters,_vars=_vars+(e,),_fr=_fr),
for e in _fr:yield e
print(*product(range(3),repeat=2))

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

(0, 0) (0, 1) (0, 2) (1, 0) (1, 1) (1, 2) (2, 0) (2, 1) (2, 2)
floral meteor
#

yes!

#

I did it!

fleet bridge
#
def product(*args, repeat=1):
    # product('ABCD', 'xy') --> Ax Ay Bx By Cx Cy Dx Dy
    # product(range(2), repeat=3) --> 000 001 010 011 100 101 110 111
    pools = [tuple(pool) for pool in args] * repeat
    result = [[]]
    for pool in pools:
        result = [x+[y] for x in result for y in pool]
    for prod in result:
        yield tuple(prod)

example from docs

floral meteor
#

yeah but tail end recursion is cool

#

and that has pools I don't like getting water near my laptop

#

my style of code has progressed much

  def aligned(_0, _1):
    _=[int()]*6
    _[:2] = _1.coords
    _[2:4] = _[0]-(_[0]%3),_[1]-(_[1]%3)
    return{
      _0[_[4],_[1]] for _[4] in range(9)
    }|{
      _0[_[0],_[5]] for _[5] in range(9)
    }|{
      _0[_[4],_[5]] for _[4] in range(_[2],_[2]+3)
                    for _[5] in range(_[3],_[3]+3)
    }^{_0[_[0],_[1]]}
fleet bridge
#

_=[int()]*6
🧐

#

_=[0]*6

floral meteor
#

it feels so wrong to put int() there, doesn't it?

#

that's why it's there

#

XD

#

i just initialising an int[] array of length 6

#

and using that for all the local variables

#

that's more readable to me than what would be considered "readable"

floral meteor
#

what about functools.reduce?

grizzled zenith
#
(lambda: chr(sum(map(lambda i: True,
                     range(-3 * True + 5 * eval('l' + chr(sum(map(lambda i: True, range(eval(
                         ''.join(
                             [str(bool.__int__(what)) for what in [True, False, True]])))))) + 'n(str(id(\'id\')))'))
                     ))))()

my first esoteric code

finite blaze
#

!e

(lambda: chr(sum(map(lambda i: True,
                     range(-3 * True + 5 * eval('l' + chr(sum(map(lambda i: True, range(eval(
                         ''.join(
                             [str(bool.__int__(what)) for what in [True, False, True]])))))) + 'n(str(id(\'id\')))'))
                     ))))() 
night quarryBOT
#

@finite blaze :warning: Your eval job has completed with return code 0.

[No output]
grizzled zenith
#

i think snekbox broke

last locust
sly root
last locust
#

It's just because it returns, not prints @grizzled zenith

sly root
grizzled zenith
#

hmm

sly root
sly root
fleet bridge
sly root
#

!e ```py
import ctypes as c
class memaddr:
init=lambda s,addr:s.setattr("addr",addr)
def write(s,d):
return 0if((lambda a:True if a is None else False)(({
int:c.c_int,
str:c.c_char_p,
bytes:c.c_char_p,
float:c.c_float,
}.get(type(d))).from_address(s.addr+type(d).basicsize).setattr("value",d)))else 1
get=lambda s,t:(t).from_address(s.addr)
repr=lambda s:"[memoryaddr: %s]"%(hex(s.addr),)
class mem_impl:
init=lambda s:s.setattr("cells",[])
def getitem(s,*cls):
with import("contextlib").suppress((SkipExc:=type("SkipExc",(Exception,),{"init":lambda s:None}))):raise[Exception("expected memaddr object, got %s"%(type(c),))if not isinstance(c,memaddr) else SkipExc for c in cls][0]
s.cells=cls[0]if type(cls[0])is tuple else cls
return s
get=lambda s,c:s.cells[c]
repr=lambda s:"[memorypack%s%s]"%(";"if len(s.cells)<1else": "," ".join([c.repr()for c in s.cells]),)
mem=mem_impl()

var = b"Test"

a = memaddr(id(var))
b = mem[a]
print(a, b)
print(b.get(0))
b.get(0).write(b"TEST")

print(var)

night quarryBOT
#

@sly root :white_check_mark: Your eval job has completed with return code 0.

001 | [memoryaddr: 0x7f4df32ac6f0] [memorypack: [memoryaddr: 0x7f4df32ac6f0]]
002 | [memoryaddr: 0x7f4df32ac6f0]
003 | b'TP\xc9*'
sly root
#

if the string isnt bytes it will not change

night quarryBOT
#

@sly root :white_check_mark: Your eval job has completed with return code 0.

001 | [memoryaddr: 0x7f7efe09e930] [memorypack: [memoryaddr: 0x7f7efe09e930]]
002 | [memoryaddr: 0x7f7efe09e930]
003 | Test
floral meteor
#

I just finished a project now I'm temporarily insane

#

weeeeee

floral meteor
#

ok I think it's over

#

it's the start of the day so let's start the daily process: how can I torture python today?

#

!e ```py
from ctypes import py_object
p = py_object.from_address(id(0)+8)
class Int(p.value):
def pow(self, other):
return'1/'
p.value = Int

print(0**-0)

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

1
floral meteor
#

it's still one

#

even ctypes agrees

#

unless this is one of those double dunder operators

sick hound
#

!e
print(0**-0)

night quarryBOT
#

@sick hound :white_check_mark: Your eval job has completed with return code 0.

1
sick hound
#

that's my new favourite way of writing 1

#

fuck ([]==[])

#

fatal error is going to be influential on this channel

#

like that one guy who completely changed how we wrote maths

#

you see I love this channel so much because we copy someone else's idea to death, until we can actually read it well. we then steal someone else's idea.

#

!e
print((([]!=[[()]][0])-1)**-0)

night quarryBOT
#

@sick hound :white_check_mark: Your eval job has completed with return code 0.

1
west cipher
#

is there like

#

a way to do JS lambda notation through some preprocesser

#

lambda x: x + 1 is so much more ugly than x => x+1

primal idol
#

No Sadge

restive void
#

...kind of

#

you can do ƒ+1 for lambda x: x + 1

#

(when defining ƒ appropriately)

west cipher
#

can i like

#

add aliases for statments?

#

like can λ alias lambda

#

ugh

restive void
#

not without recompiling cpython

west cipher
#

i might add something like that to xonsh and do my scripting exclusivity in xonsh

restive void
#

but you could make it so your editor shows you lambda as λ

west cipher
#

its like

#

if i wanna just filter a list I wanna use filter

#

if i wanna just map a list I wanna use map

#

but they're always longer

#

q = list(map(lambda x: 1 + 1, some_list))
q = [i + 1 for i in some_list]

#

q = list(map(λ x: x+1), some_list) # I'm fine with this

earnest wing
#

the closest you can get in pure python is λ.x("x + 1")

west cipher
#

well yea

#

theres rlly no way without recompiling? you used to be able to change True to something else

earnest wing
#

you can't change the parser no

#

yes but the more syntax abuse the better

#

tbd

finite blaze
#

I've seen some solutions on code.golf and they have like 100 characters but 95 bytes. How is this possible?

earnest wing
#

though it would be pretty funny to have λ.x.y.z("x*y-z")

west cipher
#

thats some metaclass stuff isn't it

finite blaze
west cipher
#

i could prob implement it; actually dont spoil it

finite blaze
#

thats why i am asking here ;p

west cipher
#

i wanna do that myself later

earnest wing
#

That seems odd

#

Maybe the submission has extra whitespace / isn't updated

restive void
#
>>> from toolib.magic import ƒ
>>> list(map(ƒ**2, range(5)))
[0, 1, 4, 9, 16]
#

ƒ is easy to type on a Mac :P

#

(but this only works as a single-argument lambda)

west cipher
#

does that just interface all functiosn with some metaclass and return a lambda?

earnest wing
#

every operator except __call__ just returns a composed function

west cipher
#

manually?

earnest wing
#

well it would be convenient with a metaclass to just iterate over a list of dunder methods

primal idol
#

My throwaway

#

!e

print(~~(not ((c:=__import__("cmath")).pi)) ** int(str(not 0.0 and (c.exp(c.sqrt(~0)*c.pi) + ~-2)**24).strip('j')))
night quarryBOT
#

@primal idol :white_check_mark: Your eval job has completed with return code 0.

1
finite blaze
#

~~

#

~-

#

didn't know that these existed

severe canyon
#
import antigravity
primal idol
#

It is the bitwise negation

#

all of them are | & ^ ~

finite blaze
#

so 0100 -> 1011?

primal idol
#

!e print(bin(~int("0100", 2)))

night quarryBOT
#

@primal idol :white_check_mark: Your eval job has completed with return code 0.

-0b101
finite blaze
#

okeeey

primal idol
#

It is because it also filps the sign

#

I dont remember exactly how it works xD

severe canyon
#

its because of two's complement

primal idol
#

Is there an actual not operaotr?

severe canyon
#

what do you mean by that?

primal idol
#

so you would expect there to be a not operator

severe canyon
#

welll

#

thats ~

#

its just because of how we choose to interpret it, that it was the effect of - x - 1

primal idol
#

Humm, I wonder what would happen if you used ~ on a unsigned ctype

severe canyon
#

try it

primal idol
#

Doing it

sick hound
#

too obvious what its doingw

severe canyon
#
a = 11111111 = 255
~a = 00000000 = 0
primal idol
#

Ah it doesnt work

#

The operation is not supported

severe canyon
primal idol
#

True

coarse void
#
l,n,p,cd,r,m,ru,wi,t,d,a,b = lambda:True if b[a].count(1)>0 else False,lambda:[i if x!=a else [*[1 for j in range(b[a-1].count(1))],*[0 for j in range(7-b[a-1].count(1))]] for x,i in enumerate(b)],lambda: [i if x!=a else [1 if (b[a-1][j]==1 and b[a][j]==1) else 0 for j in range(7)] for x,i in enumerate(b)],lambda: True if b[a][0]==1 else False if b[a][-1]==1 else None,lambda w:[0]+w[:-1] if d else w[1:]+[0],lambda:[i if x!=a else r(i) for x,i in enumerate(b)],True,__import__("pygame").display.set_mode((350,600)),__import__("time").time(),True,0,[[0,0,1,1,1,0,0],*[[0,0,0,0,0,0,0] for i in range(11)]] 
# LINE BREAK HERE --------------------------------
while ru:[[b:=p() if a!=0 else b,a:=a+1,b:=n(),ru:=l()] for event in __import__("pygame").event.get()if event.type == __import__("pygame").KEYDOWN and event.key == __import__("pygame").K_SPACE]+[d := cd() if cd() is not None else d]+[(b:=m(),t:=t+0.1) if __import__("time").time()-t > 0.1 else None]+[wi.fill((255,255,255))]+[__import__("pygame").draw.rect(wi,(0,0,0),(i2*50,i1*50,50,50)) for i1,s in enumerate(b) for i2,e in enumerate(s) if e==1]+[__import__("pygame").display.flip()]

Is this esoteric enough? Fully working game in only 2 lines lol

severe canyon
#

can you show a screenshot of it running? :O

coarse void
#

convert what into one line?

dark wharf
#
[d := cd() if cd() is not None else d]

could be

[d := cd() or d]
coarse void
#

lol I tried but couldn't do it

dark wharf
#

unless running cd twice is useful

coarse void
#

cd stands for change direction

dark wharf
#

fair enough, i assumed it wouldnt

coarse void
#

True direction means block moving to right, false is left

dark wharf
#

ah :)

coarse void
#

loool, seems useful

#

is it a really new, or a really old version?

viscid nymph
#

hopefully this will be possible soon :)

coarse void
#

But you can try converting my code into one line 😄

#

lol

#

Actually let me ask one - can we write match-cases in one-liners?

#

i mean you know, py x if b1 else x2 if b2 else x3 if b3...
works, but how ugly lol

sick hound
#

however anything can be written in 1 line.

#

.

coarse void
#

AnYthInG? Is it proven?

sick hound
#

yes.

coarse void
#

wow

sick hound
#

we should pin it honestly.

#

it's used semifrequently

#

like 2 lines without extended use of list comp is still impressive tho

coarse void
#

Without what? If this is not extended use of list comp, I don't know what is

sick hound
#

overextended use of list comp

#

like at least half of that isnt

viscid nymph
#

[_ for _ in iter(lambda:0,1)] is a cool way to do while True

sick hound
#

ooh

#

i never knew you could iter a lambda

coarse void
#

what does it do exactly? How is iter defined for lambdas?

sick hound
#

its essentially an infinite list

coarse void
#

actually how many ways are there to make infinite loops with for?

viscid nymph
#

!d iter

night quarryBOT
#

iter(object[, sentinel])```
Return an [iterator](https://docs.python.org/3/glossary.html#term-iterator) object. The first argument is interpreted very differently depending on the presence of the second argument. Without a second argument, *object* must be a collection object which supports the [iterable](https://docs.python.org/3/glossary.html#term-iterable) protocol (the `__iter__()` method), or it must support the sequence protocol (the `__getitem__()` method with integer arguments starting at `0`). If it does not support either of those protocols, [`TypeError`](https://docs.python.org/3/library/exceptions.html#TypeError "TypeError") is raised. If the second argument, *sentinel*, is given, then *object* must be a callable object. The iterator created in this case will call *object* with no arguments for each call to its [`__next__()`](https://docs.python.org/3/library/stdtypes.html#iterator.__next__ "iterator.__next__") method; if the value returned is equal to *sentinel*, [`StopIteration`](https://docs.python.org/3/library/exceptions.html#StopIteration "StopIteration") will be raised, otherwise the value will be returned.
coarse void
#

like the most basic I can think of is py a = [0] for i in a: a.append(0)

sick hound
#

guys im going to post pythonic code

#
print("hello world")
#

horrifying.

sick hound
#

||import time||

sick hound
#

__import__("time") is clearly the correct way of doing it smh

#

i wonder if it would be possible to make a game without whitespace

coarse void
#

I would gently say I'm here for you, but hell nah

coarse void
#

[(i)for(i)in(range(10))] should work

sick hound
#

yeah and list comp

#

honestly list comp is broken please nerf

coarse void
#

wtf is that xd

#

I mean I probably know it in code, but I didn't know this is what it's called

sick hound
#

[n for n in range(0,10)]

#

list comprehension

coarse void
#

oh so that is list comp

sick hound
#

list comprehensionless and whitespaceless

#

or minimum whitespace

coarse void
#

lool

#

and I believe semi-colon-less and exec-less

#

@sick hound you can just try and recreate this game in a completely different approach

sick hound
#

no then its not even esoteric

coarse void
#

send the code

#

I also have an old piano tiles code in 3 lines, and a game of life in 3 lines, but there, I used import - what a mistake

#

it worked for a bit

sick hound
#

imagine using pygame instead of doing everything on the terminal

coarse void
#

lol cool stuff

#
import pygame as pg, time as t,random as r
s,g,k,f,kp,ki,u,w = 0.01,[[-1000],[],[],[]],"dfjk",lambda:[g[i][0] if len(g[i]) > 0 else -1000 for i in range(4)],lambda n: g[n].pop(0) if f().index(max(f())) == n else pg.quit(),lambda:[w.fill((255,255,255)),[pg.draw.rect(w,(0,0,0),(id * 100,j,100,200)) for id,i in enumerate(g) for j in i],pg.display.flip()],lambda n=800: [ g[r.randint(0,3)].append(-1000) if min([i for j in g for i in j]) >= -800 else None] + [pg.quit() for j in g if len(j)>0 and j[0]>n],pg.display.set_mode((400,800))
while True:s,g=[[kp(k.index(e.unicode)) for e in pg.event.get()if e.type == pg.KEYDOWN and e.unicode in k],[ki(),u(),t.sleep(s)], s*0.9997,[[i+4 for i in j] for j in g]][-2:]

Now there you go, here is my piano tiles, but it's 3 lines what a shame

coarse void
#

you fast bro

#

Do you want to convert a game of life as well? xd

#

I mean I could probably do it as well, as I can see you just change thing to walrus, and the while to iter

severe canyon
#

show us first, then he decides xD

night quarryBOT
west cipher
#

thoughts?

#

dangit the encoding is messed up on the file, whatever should be fine once u download it i think maybe

rapid sparrow
#

!e

import sys
sys.rlimit = 1
@lambda c: c
class g:
  def __repr__(self):
    return repr(h)
  def __str__(self):
    return "%s" % g
h = g()
def f() -> h: ...
"%s" % f.__annotations__```
night quarryBOT
#

@rapid sparrow :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 11, in <module>
003 |   File "<string>", line 6, in __repr__
004 |   File "<string>", line 6, in __repr__
005 |   File "<string>", line 6, in __repr__
006 |   [Previous line repeated 330 more times]
007 | RecursionError: maximum recursion depth exceeded while calling a Python object
rapid sparrow
#

is there some kind of minimum recursion limit?

#

and anyone know anything abt the symtable module?

#

!d symtable

night quarryBOT
#

Source code: Lib/symtable.py

Symbol tables are generated by the compiler from AST just before bytecode is generated. The symbol table is responsible for calculating the scope of every identifier in the code. symtable provides an interface to examine these tables.

rapid sparrow
#

I would like to know if there's a way to

  • get an existing symbol table instead of providing new strings of code to symtable, and
  • find a way to relate the function objects in symtable back to a real python function object
#

the _symtable_symtable function is accessible as symtable._symtable.symtable()

#

looking at the C, it's this:
PyObject *_symtable_symtable(PyObject *module, PyObject *const *args, Py_ssize_t nargs);
which calls
PyObject *_symtable_symtable_impl(PyObject *module, PyObject *source, PyObject *filename, const char * startstr);

restive void
#

!e

import sys
sys.setrecursionlimit(4)
sorted([],key=len)
rapid sparrow
#

huh.

restive void
#

Huh, crashes for me locally

rapid sparrow
#

thats weird. maybe it changes if interactive?

restive void
#

But in a repl we're probably one or two levels deeper already, yes

rapid sparrow
#

interesting

rapid sparrow
#

!e I found something that's about halgway to what I'd like to do

import ctypes; import sys; PyFunction_New = ctypes.pythonapi.PyFunction_New; PyFunction_New.restype = ctypes.py_object; PyFunction_New.argtypes = [ctypes.py_object, ctypes.py_object]

def f(arg):
  def g(arg2=arg):
    print(f"{arg=} {arg2=}")
    return g

g_code = next(co for co in f.__code__.co_consts if type(co).__name__ == "code" and co.co_name == "g")
g = PyFunction_New(g_code, f.__globals__)
print(f"{f=}")
print(f"{g=}")
print(f"g()", end="=")
sys.stdout.flush()
print(g("hmm"))```
night quarryBOT
#

@rapid sparrow :x: Your eval job has completed with return code 139 (SIGSEGV).

001 | f=<function f at 0x7f9f0e5e0c10>
002 | g=<function g at 0x7f9f0e63a200>
003 | g()=
rapid sparrow
#

it's not too surprising that it segfaults there because there was no context created for the g function yet , I guess

#

another way functions are created, which is passing &f->func_globals which seems kind of odd:

#define PyFunction_AS_FRAME_CONSTRUCTOR(func) \
        ((PyFrameConstructor *)&((PyFunctionObject *)(func))->func_globals)``` to call:

PyFunctionObject * _PyFunction_FromConstructor(PyFrameConstructor *constr);```

#

there seems to be a connection between a frame in memory and the globals, somehow

#

OK, I figured out why it segfaults - it is trying to read sometghing from a closure tuple, but the closure is NULL.

coarse void
#

Hey guys, is it possible to write a function, that goes in it's own code, and puts the length of lines in a list? It'd be sick

earnest wing
#

!d inspect.getsource

night quarryBOT
#

inspect.getsource(object)```
Return the text of the source code for an object. The argument may be a module, class, method, function, traceback, frame, or code object. The source code is returned as a single string. An [`OSError`](https://docs.python.org/3/library/exceptions.html#OSError "OSError") is raised if the source code cannot be retrieved.

Changed in version 3.3: [`OSError`](https://docs.python.org/3/library/exceptions.html#OSError "OSError") is raised instead of [`IOError`](https://docs.python.org/3/library/exceptions.html#IOError "IOError"), now an alias of the former.
west cipher
#
χ.range(10).reversed.map(Φ ** 2, Ψ).list.reduce(λ.x.y("x - y"), Ψ).print()() # prints -123
#

i should not be doing this

#

but i am

earnest wing
#

Very good

#

I'm very glad with this

finite blaze
#

small question, whats a throwaway?

#

thanks

proper vault
#
for {()+(...,):{}}[(...,)+()][()+((),)] in range(4):
    pass
```this style of thing can be nested pretty deeply
primal idol
#

I am having a hard time parsing these x)

earnest wing
#

Unfortunately I don't think you can create an object without __slots__ using non-alnum ascii characters

#

Otherwise you could also do for thing._

primal idol
pure dew
#

good lord that's a clever solution

pure dew
sick hound
#

evening chat

#

print this in the stupidest way possible

#
A little girl goes into a pet show and asks for a wabbit. The shop keeper looks down at her, smiles and says:

"Would you like a lovely fluffy little white rabbit, or a cutesy wootesly little brown rabbit?"

"Actually", says the little girl, "I don't think my python would notice."
primal idol
#

I have never seen that before

coarse void
#

!e

a=lambda:(s:=map.__doc__[17])+(y:=(li()()))(n:=104)+y(n:=n+11)*2+s+str(...)[0].lower()
li=lambda:lambda:lambda lambd=(a):chr([lambd+int(True),None][:-1][0])
print(" ".join([a(),chr(range(int(str(int(True))*2+"5"),0,-1)[2**2**2*2*2-2**2**2+2])][::-1]))
night quarryBOT
#

@coarse void :white_check_mark: Your eval job has completed with return code 0.

A little
coarse void
#

This is how far I've gotten lol and I thought there is no God I'll have the patience to do this for the whole text lol

#

@sick hound

restive void
#

!e

print(int('4UKGYCY3P3W1PL5SKAKBDE12NRU29CTIKXBIKHGCMLTNX7HAFPFSPJBMG3WM2CNZR13Q7HM7XDUHWEAZWOLO6OFP6I67MTVYHMLO9KNW81ME11ERBZ0PQMLLKCK0DC5FMQ1NU2NA5GW14P1TZU2NSHG0JEAT0EAI6LC5RPBW453J3YVUD3UWPI9TFH63JC0ISSTEPSDLG87SPJ1NJ3S0CYAAH5UO4NO09TQ2OONV24SV9LRDZWKM0ERHR2AZCP4G059QLYE8AZRXD1KBNFD8LE4KGGESKRGLATA7CAWNM7RR8SDELA2NZXOO938HHVE5B2H25UH23QN7DC7EY3SIEWJZOCW0AQN78VBWWQSYAP549BLYD6X053WFIVPJQTPYYUMB743WC7H1B4Z3MJZ7VK4EHZ3RBK5JH25XWUUPVBK6AEEINMQ',36).to_bytes(281,'big').decode())
night quarryBOT
#

@restive void :white_check_mark: Your eval job has completed with return code 0.

001 | A little girl goes into a pet show and asks for a wabbit. The shop keeper looks down at her, smiles and says:
002 | 
003 | "Would you like a lovely fluffy little white rabbit, or a cutesy wootesly little brown rabbit?"
004 | 
005 | "Actually", says the little girl, "I don't think my python would notice."
sick hound
#

I've almost worked out of way to turn little into x^2

coarse void
sick hound
#

I do

near gust
#

!e

import random


def get_largest_factor(i: int) -> str:
    for h in range(i // 2, 0, -1):
        if not i % h:
            return h
    return 1 # stop pylint from complaining


def get_int_as_true(i: int, self=None) -> str:
    if i == 0:
        return '~True'
    elif i == 1:
        return 'True'
    elif i == 2:
        return random.choice(['True << True', 'True + True', '-~True'])

    elif i < 0:
        return '-(' + get_int_as_true(-i) + ')'
    else:
        c = random.randint(0, 10)
        rand = random.randint(0, i)
        if c in range(7):
            factor = get_largest_factor(i)
            if factor == 1:
                return f'-~({get_int_as_true(i-1)})'
            return f'({get_int_as_true(factor)}) * ({get_int_as_true(int(i / factor))})'
        else:
                return f'-~({get_int_as_true(i-1)})'
        

def true_convert(string: str) -> str:
    res = ''
    for char in string:
        res += f'chr({get_int_as_true(ord(char))}) + \n'
    return res[:-3]

if __name__ == '__main__':
    print(true_convert("python"))
night quarryBOT
#

@near gust :white_check_mark: Your eval job has completed with return code 0.

001 | chr(-~((-~(-~((-~((-~(-~True)) * (True << True))) * (-~((True << True) * (True << True)))))) * (-~(True << True)))) + 
002 | chr((-~((-~(-~(-~(-~True)))) * (True + True))) * (-~((-~((-~True) * (True << True))) * (True + True)))) + 
003 | chr(((-~(-~((-~(((True + True) * (True << True)) * (True + True))) * (-~(True + True))))) * (-~True)) * (-~True)) + 
004 | chr((((-~(((-~(True + True)) * (True << True)) * (True << True))) * (-~True)) * (True << True)) * (True << True)) + 
005 | chr((-~(((-~(-~(-~((-~(-~True)) * (-~True))))) * (True + True)) * (True + True))) * (-~(True << True))) + 
006 | chr((-~(-~(-~(((-~(((-~(True << True)) * (-~True)) * (True + True))) * (True + True)) * (-~True))))) * (True << True)) 
near gust
#

oops forgot to remove the newline

near gust
floral meteor
near gust
#

honestly true_convert should've been a list comprehension

floral meteor
#

yes

near gust
#

I was originally going to convert the string into binary and generate the Trues based on the bits, but that was stupid

floral meteor
#

replace True with 0**0

mighty jetty
#

How would you implement in seeding in Python?

#

Specifically protocols, like xmur3 and sfc32

west cipher
#

https://github.com/GanerCodes/Useful_Python_tomfoolery/blob/master/main.py

print('e' * χ.range(φ['k']('x * 10')).len()(k = 3))
print((Φ * 10)(2))
print(ζ("x**y + v")(2, 5, v = 5))
print(λ.a.b.c("str(a) + str(b) + str(c) + x * 15")(2, 3, 4, x = "xd"))
pjmap(χ(ρ[0]).ƒ(Φ ** 3 + 7).str(), range(5))
pjmap(Φ * 10, range(5))
pjmap(Φ ** 3 + 7, range(20))
pjmap(λ.x("x * 10"), range(5))
pjmap((Φ ** 2)._str_()[::-1], range(9))
χ.range(10).reversed.map(Φ ** 2, Ψ).list.reduce(ζ("x - y"), Ψ).print()()
χ(5).range(Ψ).map((Φ ** 3 + 7)._str_(), Ψ('x[::-1]')).ƒ(''.join).print()(5)
#

thoughts?

languid hare
#

looks like discount avl

west cipher
#

but i wanted to keep it useful and still valid python syntax

languid hare
#

autocorrect loves trees apparently

sick hound
#

what the hell

sick hound
#

hmmm i have an idea

severe canyon
#

says he has an idea
doesn't elaborate
leaves
sigma grindset

sick hound
#

right my idea has been developed

#

it is a golfing tournament

#

essentialyl

#
def game_problem(x,y):
    for selection in range(0,1):
        functions = [x,y]
        game_table = {
            (0,0) : (rand(0,5),rand(0,5)),
            (1,0) : (rand(0,5),rand(0,5)),
            (0,1) : (rand(0,5),rand(0,5)),
            (1,1) : (rand(0,5),rand(0,5)),
        }
        choice_a = functions[0](game_table,selection)
        choice_b = functions[1](game_table,not selection)
        results = game_table[(choice_a,choice_b)]

        return (results[0],results[1])

this is a non esoteric function that does a game theory table

#

it gives both function_a and function_b 2 variables: the table, and the order.

#

so essentially, you need to write a function that selects the choice (either quiet or fink for the above) that will gve them the highest score out of 100 rounds. their score being the amount of points they get out of the table

floral meteor
#

how fun would it be if * character didn't count as a byte?

#

and how much would that effect the code?

sick hound
#

powers and multiplication would be used so much

#

we should try it

severe canyon
#

so, its the prisoner's dilemma?

west cipher
#

!e (t:="​‫‫‫​​​​​‫‫‫​​‫​​‫‫​‫​​‫​‫‫​‫‫‫​​‫‫‫​‫​​​​‫​‫​​​​​‫​​‫‫‫​‫‫​‫​​​​‫‫​‫​​‫​​‫​​‫‫‫​​‫​‫​​‫") and eval(''.join(chr(int(''.join(map(lambda x:str("​‫".index(x)),t[i:i+8])),2))for i in range(0,len(t),8)))

night quarryBOT
#

@west cipher :white_check_mark: Your eval job has completed with return code 0.

hi
west cipher
#

@sick houndhey

#

what do u think

sick hound
#

interesting

west cipher
#

of this one

sick hound
#

oh go d i jsut realised what you're doing

#

🥇

west cipher
#

dang that obvious

#

i should come back and obfuscate more at some point

#

add some red harrings so its impossible to realize

#

also on an unrelated note it would be way too easy to trick someone into running a whitespace based eval

#

!e (t:="​‫‫‫​​​​​‫‫‫​​‫​​‫‫​‫​​‫​‫‫​‫‫‫​​‫‫‫​‫​​​​‫​‫​​​​‫​‫‫‫‫‫​‫​‫‫‫‫‫​‫‫​‫​​‫​‫‫​‫‫​‫​‫‫‫​​​​​‫‫​‫‫‫‫​‫‫‫​​‫​​‫‫‫​‫​​​‫​‫‫‫‫‫​‫​‫‫‫‫‫​​‫​‫​​​​​‫​​‫‫‫​‫‫​‫‫‫‫​‫‫‫​​‫‫​​‫​​‫‫‫​​‫​‫​​‫​​‫​‫‫‫​​‫‫​‫‫​​​‫‫​‫​​‫​‫‫‫​​‫‫​‫‫‫​‫​​​‫‫​​‫​​​‫‫​‫​​‫​‫‫‫​​‫​​​‫​‫​​​​​‫​‫​​‫​​‫​‫​​‫") and eval(''.join(chr(int(''.join(map(lambda x:str("​‫".index(x)),t[i:i+8])),2))for i in range(0,len(t),8)))

night quarryBOT
#

@west cipher :white_check_mark: Your eval job has completed with return code 0.

['Pipfile.lock', 'Pipfile', 'config', 'snekbox', 'user_base', 'tests', 'LICENSE']
west cipher
#

!e (t:='0123456789​‫‫‫​​​​​‫‫‫​​‫​​‫‫​‫​​‫​‫‫​‫‫‫​​‫‫‫​‫​​​​‫​‫​​​​‫​‫‫‫‫‫​‫​‫‫‫‫‫​‫‫​‫​​‫​‫‫​‫‫​‫​‫‫‫​​​​​‫‫​‫‫‫‫​‫‫‫​​‫​​‫‫‫​‫​​​‫​‫‫‫‫‫​‫​‫‫‫‫‫​​‫​‫​​​​​‫​​‫‫‫​‫‫​‫‫‫‫​‫‫‫​​‫‫​​‫​​‫‫‫​​‫​‫​​‫​​‫​‫‫‫​​‫‫​‫‫​​​‫‫​‫​​‫​‫‫‫​​‫‫​‫‫‫​‫​​​‫‫​​‫​​​‫‫​‫​​‫​‫‫‫​​‫​​​‫​‫​​​​​‫​‫​​‫​​‫​‫​​‫') and eval(''.join(chr(int(''.join(c.index(x).str()for x in t[i:i+8]),2))for i in range(0,len(t)-10,8)if bool(c:='​‫')|bool(t:=''.join(filter(c.contains,t)))))

night quarryBOT
#

@west cipher :white_check_mark: Your eval job has completed with return code 0.

['Pipfile.lock', 'Pipfile', 'config', 'snekbox', 'user_base', 'tests', 'LICENSE']
finite blaze
#

what

west cipher
#
(t:='1576408392​‫‫​​‫​‫​‫‫‫‫​​​​‫‫​​‫​‫​‫‫​​​‫‫​​‫​‫​​​​​‫​​​‫​​​‫​​​‫​​​‫​​​‫​​‫‫​‫​​‫​‫‫​‫‫​‫​‫‫‫​​​​​‫‫​‫‫‫‫​‫‫‫​​‫​​‫‫‫​‫​​​​‫​​​​​​‫‫‫​​‫‫​‫‫‫‫​​‫​‫‫‫​​‫‫​​‫​‫‫​​​‫‫​‫‫‫‫​‫‫‫​​‫‫​​‫‫‫​‫‫​‫‫​‫‫‫‫​‫‫‫​​‫‫​​‫​‫‫‫​​‫‫‫​​‫‫​‫‫‫‫​​‫​‫‫‫​​‫‫​‫‫‫​‫​​​‫‫​​‫​‫​‫‫​‫‫​‫​​‫​‫​​​​‫‫​​‫‫​​​‫​​‫‫‫​​‫​​‫‫‫​​‫​​‫‫‫​‫‫‫‫​‫‫​​‫​​‫‫‫​‫‫‫‫​​​​‫‫​​‫​​​‫‫​​‫‫‫​​‫​‫‫​‫​‫‫​‫‫‫‫​‫‫‫​​​​​‫‫​​‫​‫​‫‫​‫‫‫​​​‫​​‫‫‫​‫‫​‫​​‫​‫‫​​‫‫​​​‫​​​​​​‫‫‫​​‫‫​‫‫‫‫​​‫​‫‫‫​​‫‫​​‫​‫‫‫​​‫‫‫​​​​​‫‫​‫‫​​​‫‫​​​​‫​‫‫‫​‫​​​‫‫​​‫‫​​‫‫​‫‫‫‫​‫‫‫​​‫​​‫‫​‫‫​‫​​‫‫‫‫​‫​​‫‫‫‫​‫​​‫​​‫‫‫​‫‫​‫‫​​​‫‫​‫​​‫​‫‫​‫‫‫​​‫‫‫​‫​‫​‫‫‫‫​​​​​‫​​‫‫‫​‫‫​​‫​‫​‫‫​‫‫​​​‫‫‫​​‫‫​‫‫​​‫​‫​​‫​​‫‫‫​‫‫‫​​‫‫​‫‫‫​‫​​​‫‫​​​​‫​‫‫‫​​‫​​‫‫‫​‫​​​​‫​​​​​​​‫​​​‫​​​‫​​​‫​​​‫​​‫‫‫​‫‫‫‫‫​‫​​‫​​​​​​‫‫​‫​​​​‫‫‫​‫​​​‫‫‫​‫​​​‫‫‫​​​​​‫‫‫​​‫‫​​‫‫‫​‫​​​‫​‫‫‫‫​​‫​‫‫‫‫​‫‫‫‫​​‫​‫‫​‫‫‫‫​‫‫‫​‫​‫​‫‫‫​‫​​​‫‫‫​‫​‫​​‫​‫‫‫​​‫‫​​​‫​​‫‫​​‫​‫​​‫​‫‫‫‫​‫‫​​‫​​​‫​‫​​​‫​‫‫‫​‫‫‫​​‫‫​‫​​​‫‫‫​‫‫‫​​‫‫‫​​‫​‫​‫​‫‫‫​‫‫​​‫‫‫​‫​‫‫​​​​‫‫​​​‫‫​‫​‫​​​‫​​‫​​‫‫‫​​‫​​‫‫‫​​‫​​‫‫‫​​‫​‫​​‫​​‫​​​‫​​​‫​​​‫​​​‫​​​‫​​​‫​‫​​‫')and eval(''.join(chr(int(''.join(c.index(x).__str__()for x in t[i:i+8]),2))for i in range(0,len(t)-10,8)if bool(c:='​‫')|bool(t:=''.join(filter(c.__contains__,t)))))
#

yall should run this

finite blaze
#

!e (t:='1576408392​‫‫​​‫​‫​‫‫‫‫​​​​‫‫​​‫​‫​‫‫​​​‫‫​​‫​‫​​​​​‫​​​‫​​​‫​​​‫​​​‫​​​‫​​‫‫​‫​​‫​‫‫​‫‫​‫​‫‫‫​​​​​‫‫​‫‫‫‫​‫‫‫​​‫​​‫‫‫​‫​​​​‫​​​​​​‫‫‫​​‫‫​‫‫‫‫​​‫​‫‫‫​​‫‫​​‫​‫‫​​​‫‫​‫‫‫‫​‫‫‫​​‫‫​​‫‫‫​‫‫​‫‫​‫‫‫‫​‫‫‫​​‫‫​​‫​‫‫‫​​‫‫‫​​‫‫​‫‫‫‫​​‫​‫‫‫​​‫‫​‫‫‫​‫​​​‫‫​​‫​‫​‫‫​‫‫​‫​​‫​‫​​​​‫‫​​‫‫​​​‫​​‫‫‫​​‫​​‫‫‫​​‫​​‫‫‫​‫‫‫‫​‫‫​​‫​​‫‫‫​‫‫‫‫​​​​‫‫​​‫​​​‫‫​​‫‫‫​​‫​‫‫​‫​‫‫​‫‫‫‫​‫‫‫​​​​​‫‫​​‫​‫​‫‫​‫‫‫​​​‫​​‫‫‫​‫‫​‫​​‫​‫‫​​‫‫​​​‫​​​​​​‫‫‫​​‫‫​‫‫‫‫​​‫​‫‫‫​​‫‫​​‫​‫‫‫​​‫‫‫​​​​​‫‫​‫‫​​​‫‫​​​​‫​‫‫‫​‫​​​‫‫​​‫‫​​‫‫​‫‫‫‫​‫‫‫​​‫​​‫‫​‫‫​‫​​‫‫‫‫​‫​​‫‫‫‫​‫​​‫​​‫‫‫​‫‫​‫‫​​​‫‫​‫​​‫​‫‫​‫‫‫​​‫‫‫​‫​‫​‫‫‫‫​​​​​‫​​‫‫‫​‫‫​​‫​‫​‫‫​‫‫​​​‫‫‫​​‫‫​‫‫​​‫​‫​​‫​​‫‫‫​‫‫‫​​‫‫​‫‫‫​‫​​​‫‫​​​​‫​‫‫‫​​‫​​‫‫‫​‫​​​​‫​​​​​​​‫​​​‫​​​‫​​​‫​​​‫​​‫‫‫​‫‫‫‫‫​‫​​‫​​​​​​‫‫​‫​​​​‫‫‫​‫​​​‫‫‫​‫​​​‫‫‫​​​​​‫‫‫​​‫‫​​‫‫‫​‫​​​‫​‫‫‫‫​​‫​‫‫‫‫​‫‫‫‫​​‫​‫‫​‫‫‫‫​‫‫‫​‫​‫​‫‫‫​‫​​​‫‫‫​‫​‫​​‫​‫‫‫​​‫‫​​​‫​​‫‫​​‫​‫​​‫​‫‫‫‫​‫‫​​‫​​​‫​‫​​​‫​‫‫‫​‫‫‫​​‫‫​‫​​​‫‫‫​‫‫‫​​‫‫‫​​‫​‫​‫​‫‫‫​‫‫​​‫‫‫​‫​‫‫​​​​‫‫​​​‫‫​‫​‫​​​‫​​‫​​‫‫‫​​‫​​‫‫‫​​‫​​‫‫‫​​‫​‫​​‫​​‫​​​‫​​​‫​​​‫​​​‫​​​‫​​​‫​‫​​‫')and eval(''.join(chr(int(''.join(c.index(x).str()for x in t[i:i+8]),2))for i in range(0,len(t)-10,8)if bool(c:='​‫')|bool(t:=''.join(filter(c.contains,t)))))

night quarryBOT
#

@finite blaze :warning: Your eval job has completed with return code 0.

[No output]
finite blaze
#

why is it cut

#

!e

(t:='1576408392​‫‫​​‫​‫​‫‫‫‫​​​​‫‫​​‫​‫​‫‫​​​‫‫​​‫​‫​​​​​‫​​​‫​​​‫​​​‫​​​‫​​​‫​​‫‫​‫​​‫​‫‫​‫‫​‫​‫‫‫​​​​​‫‫​‫‫‫‫​‫‫‫​​‫​​‫‫‫​‫​​​​‫​​​​​​‫‫‫​​‫‫​‫‫‫‫​​‫​‫‫‫​​‫‫​​‫​‫‫​​​‫‫​‫‫‫‫​‫‫‫​​‫‫​​‫‫‫​‫‫​‫‫​‫‫‫‫​‫‫‫​​‫‫​​‫​‫‫‫​​‫‫‫​​‫‫​‫‫‫‫​​‫​‫‫‫​​‫‫​‫‫‫​‫​​​‫‫​​‫​‫​‫‫​‫‫​‫​​‫​‫​​​​‫‫​​‫‫​​​‫​​‫‫‫​​‫​​‫‫‫​​‫​​‫‫‫​‫‫‫‫​‫‫​​‫​​‫‫‫​‫‫‫‫​​​​‫‫​​‫​​​‫‫​​‫‫‫​​‫​‫‫​‫​‫‫​‫‫‫‫​‫‫‫​​​​​‫‫​​‫​‫​‫‫​‫‫‫​​​‫​​‫‫‫​‫‫​‫​​‫​‫‫​​‫‫​​​‫​​​​​​‫‫‫​​‫‫​‫‫‫‫​​‫​‫‫‫​​‫‫​​‫​‫‫‫​​‫‫‫​​​​​‫‫​‫‫​​​‫‫​​​​‫​‫‫‫​‫​​​‫‫​​‫‫​​‫‫​‫‫‫‫​‫‫‫​​‫​​‫‫​‫‫​‫​​‫‫‫‫​‫​​‫‫‫‫​‫​​‫​​‫‫‫​‫‫​‫‫​​​‫‫​‫​​‫​‫‫​‫‫‫​​‫‫‫​‫​‫​‫‫‫‫​​​​​‫​​‫‫‫​‫‫​​‫​‫​‫‫​‫‫​​​‫‫‫​​‫‫​‫‫​​‫​‫​​‫​​‫‫‫​‫‫‫​​‫‫​‫‫‫​‫​​​‫‫​​​​‫​‫‫‫​​‫​​‫‫‫​‫​​​​‫​​​​​​​‫​​​‫​​​‫​​​‫​​​‫​​‫‫‫​‫‫‫‫‫​‫​​‫​​​​​​‫‫​‫​​​​‫‫‫​‫​​​‫‫‫​‫​​​‫‫‫​​​​​‫‫‫​​‫‫​​‫‫‫​‫​​​‫​‫‫‫‫​​‫​‫‫‫‫​‫‫‫‫​​‫​‫‫​‫‫‫‫​‫‫‫​‫​‫​‫‫‫​‫​​​‫‫‫​‫​‫​​‫​‫‫‫​​‫‫​​​‫​​‫‫​​‫​‫​​‫​‫‫‫‫​‫‫​​‫​​​‫​‫​​​‫​‫‫‫​‫‫‫​​‫‫​‫​​​‫‫‫​‫‫‫​​‫‫‫​​‫​‫​‫​‫‫‫​‫‫​​‫‫‫​‫​‫‫​​​​‫‫​​​‫‫​‫​‫​​​‫​​‫​​‫‫‫​​‫​​‫‫‫​​‫​​‫‫‫​​‫​‫​​‫​​‫​​​‫​​​‫​​​‫​​​‫​​​‫​​​‫​‫​​‫')and eval(''.join(chr(int(''.join(c.index(x).__str__()for x in t[i:i+8]),2))for i in range(0,len(t)-10,8)if bool(c:='​‫')|bool(t:=''.join(filter(c.__contains__,t)))))
night quarryBOT
#

@finite blaze :warning: Your eval job has completed with return code 0.

[No output]
lime smelt
#

!e (t:="​‫‫‫​​​​​‫‫‫​​‫​​‫‫​‫​​‫​‫‫​‫‫‫​​‫‫‫​‫​​​​‫​‫​​​​​‫​​‫‫‫​‫‫​‫​​​​‫‫​‫​​‫​​‫​​‫‫‫​​‫​‫​​‫") and eval(''.join(chr(int(''.join(map(lambda x:str("​‫".index(x)),t[i:i+8])),2))for i in range(0,len(t),8)

night quarryBOT
finite blaze
#

oooh i see

#

there might be a way to escape from it

near gust
#

it feels like an oversight that you can't match an ellipsis in structural pattern matching. You have to bind a variable and then test if it is Ellipsis

class range:
    def __new__(cls, *args):
        if ... in args:
            match args:
                case (start, e, stop) if e is ...:
                    return __builtins__.range(start, stop + 1)
                case (start, other, e, stop) if e is ...:
                    ret = __builtins__.range(start, stop + other - start, other - start)
                    if stop not in ret:
                        raise ValueError("Invalid Ellipsis range")
                    return ret
                case (start, e, other, stop) if e is ...:
                    ret = __builtins__.range(start, 2*stop - other, stop - other)
                    if stop not in ret:
                        raise ValueError("Invalid Ellipsis range")
                    return ret
        return __builtins__.range(*args)
#

and using the name Ellipsis rebinds a local variable

sick hound
#

looking for genuine advice

#

does this code look dirty to anyone?

#

i find it neat yet my friend dont

#

just rate it for neatness

#

/10

#
class CustomDict(dict):
    
    def __setitem__(self, key, value):
       
        if key in self.keys():
            new = [self[key], value] if not isinstance(self[key],list) else self[key] + [value]
            dict.__setitem__(self, key, new)
            
        else: dict.__setitem__(self, key, value)


class overloads(type):
    
    def __prepare__(name, bases):
        
        return CustomDict()
        
    def __new__(cls, name, bases, dct):

        def choose(lst):
            
            annotate = [list(fn.__annotations__.values()) for fn in lst]
            
            def wrapper(*args):
                
                for num , a in enumerate(annotate):


                    check = [type(arg) == annotation for arg, annotation in zip(list(args)[1:], a)]
                    if all(check): return lst[num](*args)

                return None
            
            return wrapper
            
        
        edited_dct = {}

        for key, value in dct.items():

            if isinstance(value, list) and callable(value[0]): edited_dct[key] = choose(value)
            
            else: edited_dct[key] = value

                
        return type(name, bases, edited_dct)

    





class Funcs(metaclass=overloads):
    
    def add(self, a: int, b: int): return a + b
    
    def add(self, a: str, b: str): return f'{a} {b} it worked!'
    
    def add(self, a: int, b: str): return b*a
sick hound
#

stop

#

you're not healthy

earnest wing
#

also there is now a maximum score that any possible challenge can take on

fleet bridge
#

!e print("123")

night quarryBOT
#

@fleet bridge :warning: Your eval job has completed with return code 0.

[No output]
fleet bridge
#

!e ```py
s = '`'
print(s * 3 + '!' + s * 3)

night quarryBOT
sick hound
#

hmmm

#

we are going to break it.

#
if ESCAPE_REGEX.findall(output):
            paste_link = await self.upload_output(original_output)
            return "Code block escape attempt detected; will not output result", paste_link

found the code that manages that.

#
ESCAPE_REGEX = re.compile("[`\u202E\u200B]{3,}")

no idea what this is doing tho...

#

ah nvm i understand.

#

so its checking for 3 repetitions of the backtick

#

hmm.

sick hound
#

its impossible.

sick hound
#

sad

fleet bridge
#

!e print("Code block escape attempt detected; will not output result")

night quarryBOT
#

@fleet bridge :white_check_mark: Your eval job has completed with return code 0.

Code block escape attempt detected; will not output result
sick hound
#
exec("""print((l:=["print", "('<{}>>')", "format"])[0],[1],f"{l[0]}.format('[({l})==({l})]'.join(l))")""")
fleet bridge
#

!e
exec("""print((l:=["print", "('<{}>>')", "format"])[0],[1],f"{l[0]}.format('[({l})==({l})]'.join(l))")""")

night quarryBOT
#

@fleet bridge :white_check_mark: Your eval job has completed with return code 0.

print [1] print.format('[(['print', "('<{}>>')", 'format'])==(['print', "('<{}>>')", 'format'])]'.join(l))
sick hound
#

funny

#

you see it looks like a complete mess of code and outputs a complete mess of code

finite blaze
#

i know you can do this : )

near gust
#

!e

print ("`\u200b`\u200b`\u200a")
night quarryBOT
near gust
#

!e

print("``\u200a`")
night quarryBOT
#

@near gust :white_check_mark: Your eval job has completed with return code 0.

`` `
near gust
#

!e

print("``\u200b`")
night quarryBOT
near gust
#

interesting

vague cairn
#

🙂

dark wharf
#

You can break out of it btw, it's a known issue

#

with how discord handles large amounts of escape sequences

vague cairn
#

!e print('!e print('hello world!')')

#

!e print('!e `print("hello world!")`')

night quarryBOT
#

@vague cairn :white_check_mark: Your eval job has completed with return code 0.

!e `print("hello world!")`
vague cairn
#

Ok, so that's not what you're worrying about happening, what is the problem and the strategy that you're investigating?

dark wharf
#

#bot-commands message

#

it just works, nobody's really bothered to fix it tho

dense skiff
#

How?

#

!e

print("\`\`\`this?")
night quarryBOT
#

@dense skiff :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 2
002 |     print("
003 |           ^
004 | SyntaxError: unterminated string literal (detected at line 2)
dense skiff
#

!e

print("```this?```")
night quarryBOT
#

@dense skiff :white_check_mark: Your eval job has completed with return code 0.

\`\`\`this?
next flame
#

#bot-commands

#

thank

near gust
next flame
#

xd

earnest wing
night quarryBOT
#

@sick hound :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 1
002 |     print("
003 |           ^
004 | SyntaxError: unterminated string literal (detected at line 1)
#

@sick hound :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 1
002 |     print("
003 |           ^
004 | SyntaxError: unterminated string literal (detected at line 1)
finite blaze
#

!e print("`"*(2**8))

night quarryBOT
last locust
#

Stuff trying to break the bot should be going in #bot-commands please

#

This channel is for esoteric python, not bot testing

severe canyon
#

!e

f=1 .__and__
print(f(3))
night quarryBOT
#

@severe canyon :white_check_mark: Your eval job has completed with return code 0.

1
severe canyon
#

this is pretty neat

#

not really esoteric i guess

sick hound
#

its very esoteric

sick hound
#

!e

west cipher
#

also dot notation works with a space

#

how am i still learning about this langauge

sick hound
#

!e ```py
print(chr(((~~(l:=lambda:(f:=~(((lambda x:3x)(((f:=lambda:7)()).and(2^63))))))())-630)+4))

night quarryBOT
#

@sick hound :white_check_mark: Your eval job has completed with return code 0.

sick hound
#

❤️

severe canyon
#

Space because otherwise the dot is treated as a continuation of the number

finite blaze
#

need to learn about all these __thingy__

fleet bridge
finite blaze
#

thanks

fleet bridge
#

I have rearranged this list a little

sick hound
#

i haven't really experimented with pattern matching, anyone know some weird stuff you can do with it?

restive void
floral meteor
jovial monolith
#

i did some illegal python code in there

earnest wing
#
@type.__call__
class rm:
    def __sub__(s,o):
        import os
        os.system(f"[insert the rm command here, retracted for safety] {o}")

# ...
rm -rf"/" 
sly root
#

made new dsl

#
@use structures;
@use datetime;

struct human {
  name: str
  age: int
  born: datetime.timedelta
};

this gets parsed to

{
  'name': 'human', 
  'fields': {
    'name': <class 'str'>,
    'age': <class 'int'>,
    'born': <class 'datetime.timedelta'>
  }
}
sly root
#

use keyword is just literally __import__

pure dew
#

why not a dataclass

sly root
pure dew
#

heh, fair point

restive void
#

!e

for type(
    type.__name__,
    (),
    {
        type.__name__: type(
            type.__name__,
            (),
            {
                "__{0}__".format(
                    type({0}).__name__
                ): lambda * type: print(type[(type==type)+(type==type)])
            },
        )(),
    },
)().type in range(7): pass
night quarryBOT
#

@restive void :white_check_mark: Your eval job has completed with return code 0.

001 | 0
002 | 1
003 | 2
004 | 3
005 | 4
006 | 5
007 | 6
halcyon surge
#

hey people, im just curious, how did you get into esoteric py? i didnt even know it existed, did you guys want an extension of python for a challenge? or?

restive void
#

Also I miss doing art in my job :D

halcyon surge
restive void
halcyon surge
#

Wow, that’s super cool, I’ll definitely check it out. And these esolangs can be implemented like any standard Lang right?

restive void
#

I think there are some that can't, but mine are all implemented at least once

night quarryBOT
#

@sick hound :white_check_mark: Your eval job has completed with return code 0.

12
finite blaze
#

Yeah

#

That makes sense

#

!e print((* +2 +2))

night quarryBOT
#

@finite blaze :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 1
002 |     print((* +2 +2))
003 |            ^^^^^^^
004 | SyntaxError: cannot use starred expression here
finite blaze
#

Naaah

viscid nymph
#

adding a comma to make it a tuple would work (apart from the type error)

near gust
floral meteor
#

!e ```py
globals().clear()
builtins={}

no brackets after this

build_class=lambda*a:0
name='main'
sub = ....class.base.subclasses
@sub.class.call
@lambda _:sub
class a:0

try:
@a.getitem
@lambda _:84
class b:0
a.load_module
except:
@a.getitem
@lambda _:104
class b:0

@b.load_module
@lambda _:'sys'
class a:0

@a.stdout.write
@lambda _:"Hello World!\n"
class a:0

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

Hello World!
sick hound
#

honestly I think that obfuscating code is best when the output is completely expected

#

ok

odd jay
#

sorry

#

ohh okey

golden finch
#

In a function's __code__ attribute, where are the argument names located?

last locust
night quarryBOT
#

@last locust :white_check_mark: Your eval job has completed with return code 0.

('a', 'b')
last locust
#
>>> def foo(a, *, b, c=None):
    pass

>>> foo.__code__.co_varnames
('a', 'b', 'c')```note that it doesn't distinguish between different types of args
golden finch
#

That seems to be what I'm looking for, thanks!

#

The reason is kinda cursed so that's why I'm here

last locust
#

Heh

golden finch
#

something like:

#
def decorate(...):
  ...

@decorate(3):
def f():
  return a+b+c

print(f(1,2,3))#6
#

should be relatively easy to implement

polar plover
#

!e ```python
def foo(a, b):
x = 123

print(foo.code.co_varnames)``` it is not only arguments

night quarryBOT
#

@polar plover :white_check_mark: Your eval job has completed with return code 0.

('a', 'b', 'x')
golden finch
#

oh boy

#

thank you

#

how can I extract just the argument names?

polar plover
#

!e from what can tell the arguments are orderd first in that tuple, so ```py
def foo(a, b):
x = 123

print(foo.code.co_varnames[:foo.code.co_argcount])```

night quarryBOT
#

@polar plover :white_check_mark: Your eval job has completed with return code 0.

('a', 'b')
proper vault
#

I suggest using inspect here

severe canyon
#

!e

for i in range(100):globals()[f'sh{"e"*i}sh']=i
print(shsh)
print(sheesh)
print(sheeeeesh)
night quarryBOT
#

@severe canyon :white_check_mark: Your eval job has completed with return code 0.

001 | 0
002 | 2
003 | 5
severe canyon
#

why do i find this funny

vague cairn
# severe canyon !e ```py for i in range(100):globals()[f'sh{"e"*i}sh']=i print(shsh) print(shees...

!e

LETTER = lambda x:chr(x + ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss0)
letter = lambda x:chr(x + ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss0)
letters = lambda *xs:''.join([letter(x) for x in xs])
Letters = lambda *xs: LETTER(xs[0]) + letters(*xs[1:])
print(Letters(ssssssss0, sssss0,ssssssssssss0,ssssssssssss0,sssssssssssssss0, -ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss0, sssssssssssssssssssssss0, sssssssssssssss0, ssssssssssssssssss0,ssssssssssss0,ssss0,-sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss0))

looks like peano arithmetic to me.

night quarryBOT
#

@vague cairn :white_check_mark: Your eval job has completed with return code 0.

Hello world!
severe canyon
#

🐍

vague cairn
#

looks like the start of a new obfuscation class: you get two '1's and as many '0's as you want, but no other digits...

torn garnet
#

!e

vague cairn
#

actually... the first '1' is easy to replace with True, the second shouldn't be very much more difficult...

restive void
severe canyon
#

!e

f=lambda i:'0'*int(f'1{"".join("{0:03b}".format("><+-.,[]".index(l))for l in i)}',2)
print(len(f(",[.,]")))
night quarryBOT
#

@severe canyon :white_check_mark: Your eval job has completed with return code 0.

56623
severe canyon
#

brainfuck to unary converter :D

#

please golf this more

#

nvm this doesnt actually work

#

ok, now it should

whole vessel
#

Hi

#

I have a question about threading

#

I use

threadName.start()
#

To start the thread but i dont know how to stopeed

#

Someone can help me?

pastel ibex
severe canyon
#

!e

f=lambda i,a=0:'0'*([a:=a*8+"><+-.,[]".index(l)for l in i][-1]+2**len(i*3))
print(len(f(",[.,]")))
night quarryBOT
#

@severe canyon :white_check_mark: Your eval job has completed with return code 0.

56623
severe canyon
#

shorter ¯_(ツ)_/¯

whole vessel
finite blaze
#

Can't you make it a oneliner?

severe canyon
#

it is

floral meteor
#

It's two different scripts, the preprocessor and the driver.
They could be concatenated or intermingled, but that would be pointless.

viscid nymph
#

It’s just one of the attributes of the compiled bytecode

severe canyon
#

can you get around this?

earnest wing
#

Is the error trying to assign to __code__ or to co_code because for the latter you can just replace(...) and assign the copied code object instead

severe canyon
#

my guess would be for co_code

#

can you give a code example for the replace thingy?

earnest wing
#

!e ```py
def foo(): print("hey")

foo.code = foo.code.replace(co_consts=(None, "hi there"))

foo()

night quarryBOT
#

@earnest wing :white_check_mark: Your eval job has completed with return code 0.

hi there
severe canyon
#

ty

severe canyon
#

!e

f=lambda n:n*n
n=bytes([124,0,124,0,23,0,83,0])
print(f(3))
f.__code__ = f.__code__.replace(co_code=n)
print(f(3))
night quarryBOT
#

@severe canyon :white_check_mark: Your eval job has completed with return code 0.

001 | 9
002 | 6
severe canyon
#

fun!, gonna mess around with this

amber silo
#

!e
print("Hello")

sly root
dense nova
#

ok

#

then wont setting it to n just return the number it self

#

why?

#

alr

severe canyon
#

damn, the dis module gives you a lot of info to work with

#

all bytecode opcodes and disassembly of functions :O

#

!e

import dis
f=lambda n:1if n<2else f(n-1)*n
print(dis.dis(f))
night quarryBOT
#

@severe canyon :white_check_mark: Your eval job has completed with return code 0.

001 |   2           0 LOAD_FAST                0 (n)
002 |               2 LOAD_CONST               1 (2)
003 |               4 COMPARE_OP               0 (<)
004 |               6 POP_JUMP_IF_FALSE        6 (to 12)
005 |               8 LOAD_CONST               2 (1)
006 |              10 RETURN_VALUE
007 |         >>   12 LOAD_GLOBAL              0 (f)
008 |              14 LOAD_FAST                0 (n)
009 |              16 LOAD_CONST               2 (1)
010 |              18 BINARY_SUBTRACT
011 |              20 CALL_FUNCTION            1
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/goyuluzika.txt?noredirect

severe canyon
#

why is that?

#

ah

bitter lake
#

https://sourceb.in/w7aXsAQN5VOkay this is my filetree and I have a function called timestamps_av in my info.py file but when I do from .info import timestamps_av,fromcogs .info import timestamps_av or from info import timestamps_avin events.py it errors telling me it can't find it

(Also asked in #discord-bots a few mins ago but thought this might be better place to ask)

next flame
bitter lake
bitter lake
errant crescent
#

good to know.

gleaming timber
#

how to generate primes

#

[i for i in range(2,100) if i in (2,3,5,7) or (i%6==1 or i%6==5) and i%5!=0 and i%7!=0]

#

!e ```py
[i for i in range(2,100) if i in (2,3,5,7) or (i%6==1 or i%6==5) and i%5!=0 and i%7!=0]

night quarryBOT
#

@gleaming timber :warning: Your eval job has completed with return code 0.

[No output]
gleaming timber
#

!e ```py
print([i for i in range(2,100) if i in (2,3,5,7) or (i%6==1 or i%6==5) and i%5!=0 and i%7!=0])

night quarryBOT
#

@gleaming timber :white_check_mark: Your eval job has completed with return code 0.

[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]
floral meteor
#

!e ```py
print(*filter(lambda i:i in(2,3,5,7)or(i%6 in(1,5))and i%5 and i%7,range(2,100)))

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97
gleaming timber
#

!e

print(2,3,5,7,*[i for i in range(2,100)if(i%6 in(1,5))and not(i%5==0 or i%7==0)])
night quarryBOT
#

@gleaming timber :white_check_mark: Your eval job has completed with return code 0.

2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97
floral meteor
#

!e ```py
print(2,3,5,7,*filter(lambda i:all([(i%6 in(1,5)),i%5,i%7]),range(2,100)))

#

mine's shorter

jovial monolith
#

almao what

floral meteor
#

ya do

#

it takes one argument

jovial monolith
#

you can pass a generator/iterable i forgot what it's calle

floral meteor
#

aight, but that's no less characters than a list

#

so a list i make

jovial monolith
#

!e

print(2,3,5,7,*filter(lambda i:all((i%6 in(1,5)),i%5,i%7),range(2,100)))```
night quarryBOT
#

@jovial monolith :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 |   File "<string>", line 1, in <lambda>
004 | TypeError: all() takes exactly one argument (3 given)
jovial monolith
#

UHH

floral meteor
#

told you

jovial monolith
#

oh i misread it xD

night quarryBOT
#

@sick hound :white_check_mark: Your eval job has completed with return code 0.

2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97
#

@sick hound :white_check_mark: Your eval job has completed with return code 0.

2 3 5 7 1 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97
near gust
#

You know how std[::cout] << "Hello World!"? I took it another step further because I was bored in class today.
https://paste.pythondiscord.com/useserajac.rb

std[::vector]<int,_> 'a';

a.push_back(10);
a.push_back(1);
a.push_back(69420);

for i in a:
    std[::cout] << i << " ";

std[::cout] << '\n'
#

now with templates (kinda not really)

night quarryBOT
#

@sick hound :warning: Your eval job has completed with return code 0.

[No output]
floral meteor
#

nothing happened

severe canyon
#
k=P=1
while k<100:P%k>0==print(k);P*=k*k;k+=1
#

Don't forget this classic

finite blaze
#

Hey, what would be the shortest way to open a file and save all lines into a list

#

with all lines stripped

finite blaze
#

x= [l.rstrip() for l open("i")]

#

i dont think that thats the fastest way

earnest wing
#

x=[*map(str.rstrip,open("i"))]
x=[l.rstrip()for l in open("i")]
hmm it's actually longer

#

wait no it's shorter the chat textbox was just bad

finite blaze
#

thanks

pure dew
#

why rstrip and not strip?

viscid nymph
pure dew
#

well yea

#

but why wouldn't you want full stripping when reading from the file?

viscid nymph
#

Whitespace at the beginning of a line could be indentation etc

floral meteor
near gust
#

it required a complete redo of the template code by making template_base a metaclass

#

and doing other stuff

near gust
#
template<(T, template<(U, V),_>_), _>'name'
pure dew
#

i think you would like my trait library

#

it does Rust-style traits

pure dew
#

what does H mean

pure dew
#

no, that's U+1D129 𝄩

near gust
#
std[::vector]<int,_>'vec',_ == {1, 2, 3}
std[::vector]<int,_>'vec',_('iterator', 'constructor here')
#

time to implement the actual vector interface

#

oh god

#

iterators

#

having to hack ++i

#

chained comparison

#

also that would try to call the string

#

operator precedence

#

I also tried == directly but that doesn't work because of chained comparison

#

_ is a temp variable that here gets assigned to be the class object
template_meta.__gt__(self, other: typing.Union[str, template_meta]) returns the class if both sides are the same object, otherwise assigns the namespaces variable of that name to the class

#

then == calls __call__, which constructs an instance of the class with the args. If self._var is defined on the class (which it is defined when there's a call to > when the right argument is not self), it sets the variable named by that variable to be the instance of the class and returns the instance (the same object)

manic rune
#
 print((lambda: getattr(getattr, '__name__')[0])() + __import__('string').ascii_lowercase[0 << 69] + getattr(any, '__name__')[int(hex(343433234222)[((-2 << 2) / 4).__int__()])])
#

made it myself 🙂

finite blaze
#

!e print((lambda: getattr(getattr, 'name')[0])() + import('string').ascii_lowercase[0 << 69] + getattr(any, 'name')[int(hex(343433234222)[((-2 << 2) / 4).int()])])

night quarryBOT
#

@finite blaze :white_check_mark: Your eval job has completed with return code 0.

gay
severe canyon
rough mulch
#

!e

 print((lambda: getattr(getattr, '__name__')[0])() + __import__('string').ascii_lowercase[0 << 69] + getattr(any, '__name__')[int(hex(343433234222)[((-2 << 2) / 4).__int__()])])
night quarryBOT
#

@rough mulch :white_check_mark: Your eval job has completed with return code 0.

gay
rough mulch
#

woah

#

impossible

floral meteor
#

aww the very misleading pair of messages got deleted

floral meteor
#

it's called obfuscation

rough mulch
#

🧐

near gust
rough mulch
#

it smg convert 343433234222 to msg

floral meteor
#

!e then there's the opposite:

@type.__call__
class cout:
  def __lshift__(self, string):
    print(string)
    return self
endl = '\n'

cout << "Hello World!" << endl;
rough mulch
#

epic

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

Hello World!
rough mulch
#

!e

print("Hello World!")
night quarryBOT
#

@rough mulch :white_check_mark: Your eval job has completed with return code 0.

Hello World!
rough mulch
#

😂

floral meteor
#

getattr(getattr, '__name__')[0] gets the first character of 'getattr'

rough mulch
#

ok

floral meteor
#

0 << 69 is 0

rough mulch
#

ok

floral meteor
#

first ascii lowercase character is a

rough mulch
#
__import__('string').ascii_lowercase[0 << 69] + getattr(any, '__name__')[int(hex(343433234222)[((-2 << 2) / 4).__int__()])])
```???
floral meteor
#

and the crazy integer stuff simplifies to 2

rough mulch
#

ok..

floral meteor
#

so the third character of "any"

rough mulch
#

..

floral meteor
#

Quad Et Deobfuscatum

rough mulch
#

i have no idea

#

interview bl:
Print("Hello")
make it so complex that anyone cant understand lol

floral meteor
#

who likes my abuse of Latin?

rough mulch
floral meteor
#

-2th index is '2'

rough mulch
#

!e
print(getattr'[0] + 'abcdefghijklmnopqrstuvwxyz'[0] + 'any'[int('0x4ff637472e'[-2])])

night quarryBOT
#

@rough mulch :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 1
002 |     print(getattr'[0] + 'abcdefghijklmnopqrstuvwxyz'[0] + 'any'[int('0x4ff637472e'[-2])])
003 |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
004 | SyntaxError: invalid syntax. Perhaps you forgot a comma?
rough mulch
#

lol

#

`oh

#

!e
'getattr'[0] + 'abcdefghijklmnopqrstuvwxyz'[0] + 'any'[int('0x4ff637472e'[-2])]

night quarryBOT
#

@rough mulch :warning: Your eval job has completed with return code 0.

[No output]
floral meteor
# rough mulch interview bl: Print("Hello") make it so complex that anyone cant understand lol

!e ```py
a, i = [0,0,0,0,0,0], 0
a[i] = a[i] + 10
while a[i]:
i += 1
a[i] = a[i] + 3
i += 1
a[i] = a[i] + 7
i += 1
a[i] = a[i] + 8
i += 1
a[i] = a[i] + 10
i += 1
a[i] = a[i] + 11
i -= 5
a[i] = a[i] - 1
i += 2
a[i] = a[i] + 2
print(end=chr(a[i]))
i += 2
a[i] = a[i] + 1
print(end=chr(a[i]))
a[i] = a[i] + 7
print(end=chr(a[i])*2)
i += 1
a[i] = a[i] + 1
print(end=chr(a[i]))
i -= 4
a[i] = a[i] + 2
print(end=chr(a[i]))
i += 2
a[i] = a[i] + 7
print(end=chr(a[i]))
i += 2
print(end=chr(a[i]))
a[i] = a[i] + 3
print(end=chr(a[i]))
i -= 1
print(end=chr(a[i]))
a[i] = a[i] - 8
print(end=chr(a[i]))
i -= 3
a[i] = a[i] + 1
print(chr(a[i]))

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

Hello World!
rough mulch
#

huh

terse oriole
#

!e

print(__builtins__.str().join(map(chr,[q:=-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~0,u:=-~-~-~-~q,u-ord('>')//(-~-~-~0),sum(map(ord, filter(lambda m: isinstance(ord(m), int), list('%>')))),u-(-~-~-~-~-~-~-~-~-~-~0)])))
night quarryBOT
#

@terse oriole :white_check_mark: Your eval job has completed with return code 0.

quack
terse oriole
#

That... worked?

floral meteor
#

nope

#

original

rough mulch
#

!e
getattr'[0] + 'abcdefghijklmnopqrstuvwxyz'[0] + 'any'[int('0x4ff637472e'[-2])]

night quarryBOT
#

@rough mulch :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 1
002 |     getattr'[0] + 'abcdefghijklmnopqrstuvwxyz'[0] + 'any'[int('0x4ff637472e'[-2])]
003 |                                                                            ^
004 | SyntaxError: unterminated string literal (detected at line 1)
rough mulch
#

hec

#

!e
'getattr'[0] + 'abcdefghijklmnopqrstuvwxyz'[0] + 'any'[int('0x4ff637472e'[-2])]

night quarryBOT
#

@rough mulch :warning: Your eval job has completed with return code 0.

[No output]
floral meteor
#

I typed the damn thing manually

rough mulch
floral meteor
#

although I could make a script to generate that given any message

floral meteor
#

I made it

rough mulch
#

what is it called

terse oriole
#

!e

(lambda _, __, ___: (lambda p, ____________________, ___: [print(__import__('this').d.get(____, ____), end='', file=p) for ____ in ___])(__.stdout, setattr(__, 'stdout', open(_.devnull, 'w')), ___))(__import__('os'), __import__('sys'), 'frperg zrffntr')
night quarryBOT
#

@terse oriole :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 |   File "<string>", line 1, in <lambda>
004 | FileNotFoundError: [Errno 2] No such file or directory: '/dev/null'
rough mulch
#

??

#

its for confusing code

floral meteor
terse oriole
#

Works fine in an IDLE shell I think?

floral meteor
#

however I only used 6 memory cells so it isn't Turing Complete

rough mulch
#

..

floral meteor
#

the concept behind it is turing complete though

floral meteor
#

it is a transpilation from python to brainfuck, and back to python again

rough mulch
#

lol

#

flex probaly

floral meteor
#

manually

floral meteor
rough mulch
#

@floral meteor print 5 table with 1 line

maiden river
#

!e Yo how's this workin

print(__builtins__.str().join(map(chr,[q:=-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~0,u:=-~-~-~-~q,u-ord('>')//(-~-~-~0),sum(map(ord, filter(lambda m: isinstance(ord(m), int), list('%>')))),u-(-~-~-~-~-~-~-~-~-~-~0)])))
night quarryBOT
#

@maiden river :white_check_mark: Your eval job has completed with return code 0.

quack
rough mulch
#

🪐  .   .✦˚  .  ✦˚     .  ˚  . ✦  ˚ .🌍
 ˚   . ✦    .        ˚     *     ✦   .  .        ˚
 .   ✦   🌒 .     ˚   .

#

yoooooo

#

i was searching for this status for soo long

maiden river
#

inderesdin

rough mulch
#

!e

print(__builtins__.str().join(map(chr,[q:=-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~0,u:=-~-~-~-~q,u-ord('>')//(-~-~-~0),sum(map(ord, filter(lambda m: isinstance(ord(m), int), list('%>')))),u-(-~-~-~-~-~-~-~-~-~-~0)])))```
night quarryBOT
#

@rough mulch :white_check_mark: Your eval job has completed with return code 0.

quack
rough mulch
#

!e

print(__builtins__.str().join(map(chr,[s:=-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~0,u:=-~-~-~-~q,u-ord('>')//(-~-~-~0),sum(map(ord, filter(lambda m: isinstance(ord(m), int), list('%>')))),u-(-~-~-~-~-~-~-~-~-~-~0)])))```
night quarryBOT
#

@rough mulch :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | NameError: name 'q' is not defined
rough mulch
#

!e

print(__builtins__.str().join(map(chr,[s:=-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~0,u:=-~-~-~-~s,u-ord('>')//(-~-~-~0),sum(map(ord, filter(lambda m: isinstance(ord(m), int), list('%>')))),u-(-~-~-~-~-~-~-~-~-~-~0)])))```
night quarryBOT
#

@rough mulch :white_check_mark: Your eval job has completed with return code 0.

quack
rough mulch
#

hec?

earnest wing
floral meteor
#

woops

night quarryBOT
#

@terse oriole :white_check_mark: Your eval job has completed with return code 0.

1
terse oriole
#

Basically increments it so much that it reaches the ord value of the characters

terse oriole
#

It somewhat works in terminal and works as intended in an IDLE shell

floral meteor
#

this is me tryna make my code more readable:

terse oriole
#

Readable is relative...

floral meteor
#

the lambda list is one of those "works for the wrong reason" things

terse oriole
#

Heh

#

Esoteric python permanently destroys your code forever

night quarryBOT
#

@sly root :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | ModuleNotFoundError: No module named 'requests'
sly root
#

pog

floral meteor
#

@sly root ❌ Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | BotUsageError: Please use #bot-commands for non-esoteric bot commands.
sly root
floral meteor
#

but then you deleted it

#

if bot not work, just the code will do

rapid sparrow
#

the bot knows what's esoteric and what isn't ?

sly root
#

i tried to load it with request but module is not installed

sick hound
fleet bridge
#

It isnt an operator

#

It is object Ellipsis

#

!e print(...)

night quarryBOT
#

@fleet bridge :white_check_mark: Your eval job has completed with return code 0.

Ellipsis
fleet bridge
#

You can use it as expression like any other expression

floral meteor
#

!e ```py
print(....lt(...))

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

NotImplemented
floral meteor
#

dumb idea to abstract away ANSI escape sequences

class _escape_sequence:
  def __init__(self, item):
    self._s='\x1b['+str(item).replace('(','').replace(')','').replace(',',';')
  def __getattribute__(self, attr):
    try:return super().__getattribute__(attr)
    except:return self._s+attr
@type.__call__
class x1b:
  def __getitem__(self, item):
    return _escape_sequence(item)

print(\
  x1b[32].m + "Green text." + \
  x1b[0].m)
#

any escape sequence works

golden finch
#

!e

def argumentwrap(x):
  args=[x.__annotations__['f'](i)for i in range(x.__annotations__['n'])]
  argcount=len(args)
  co_names=tuple(i for i in x.__code__.co_names if not i in args)
  co_varnames=tuple(i for i in args)+tuple(i for i in x.__code__.co_varnames if i not in[*'nf'])
  co_consts=tuple(i for i in x.__code__.co_consts if i!=x.__doc__)
  co_code=''
  for i in range(0,len(x.__code__.co_code),2):
    if x.__code__.co_code[i]==124:
      co_code+='|'+chr(co_varnames.index(x.__code__.co_varnames[x.__code__.co_code[i+1]]))
    elif x.__code__.co_code[i]==116:
      if x.__code__.co_names[x.__code__.co_code[i+1]] in args:
        co_code+='|'+chr(co_varnames.index(x.__code__.co_names[x.__code__.co_code[i+1]]))
      else:
        co_code+='t'+chr(co_names.index(x.__code__.co_names[x.__code__.co_code[i+1]]))
    elif x.__code__.co_code[i]==100:
      co_code+='d'+chr(co_consts.index(x.__code__.co_consts[x.__code__.co_code[i+1]]))
    elif x.__code__.co_code[i]==125:
      co_code+='}'+chr(co_varnames.index(x.__code__.co_varnames[x.__code__.co_code[i+1]]))
    elif x.__code__.co_code[i]==160:
      co_code+='\xa0'+chr(co_names.index(x.__code__.co_names[x.__code__.co_code[i+1]]))
    else:
      co_code+=x.__code__.co_code[i:i+2].decode(x.__doc__)
  co_code=co_code.encode(x.__doc__)
  co_nlocals=len(co_varnames)
  return type(lambda:0)(x.__code__.replace(co_argcount=argcount,co_names=co_names,co_varnames=co_varnames,co_consts=co_consts,co_code=co_code,co_nlocals=co_nlocals),globals())

@argumentwrap
def f(n:3,f:lambda i:chr(i+97)):
  'iso-8859-1'
  print(a,b,c)

f(1,'2',None)
night quarryBOT
#

@golden finch :white_check_mark: Your eval job has completed with return code 0.

1 2 None
golden finch
#

anyone done something like this before?

terse oriole
#

uhhhh no?

golden finch
#

you never know

#

but it seems like a common enough idea somebody would do it

terse oriole
#

!e

raise_ = lambda ack:(_ for _ in [1]).throw(Exception(ack))
try:
  raise_('qu')
except Exception as e:
  a = str(e)
  b = ''.join(__import__('inspect').signature(raise_).parameters)
print(a+b)
night quarryBOT
#

@terse oriole :white_check_mark: Your eval job has completed with return code 0.

quack
floral meteor
#

anonymousdeveloper: writes some obscure bytecode hack
also anonymousdeveloper: "You should've done this before, anybody would do it"

terse oriole
#

why do I keep making print quack code...

floral meteor
#

(()for()in()).throw

terse oriole
#

oh god

floral meteor
#

you asked

#

!e ```py
(()for()in()).throw(Exception, 'XD')

night quarryBOT
#

@floral meteor :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 |   File "<string>", line 1, in <genexpr>
004 | Exception: XD
terse oriole
#

!e

raise_=lambda ack:(()for()in()).throw(Exception(ack))
try:
  raise_('qu')
except Exception as e:
  a=__builtins__.str(e)
  b=''.join(__import__('inspect').signature(raise_).parameters)
print(a+b)
night quarryBOT
#

@terse oriole :white_check_mark: Your eval job has completed with return code 0.

quack
golden finch
floral meteor
#

(lambda ack:(()for()in()).throw(Exception(ack)))('qu')

terse oriole
#

onelined

floral meteor
#

after the try:

terse oriole
#

yeah

floral meteor
#

try:(lambda ack:(()for()in()).throw(Exception(ack)))('qu')

terse oriole
#

I was doing some testing with throw

#

!e

(lambda _, __, ___: (lambda p, ____________________, ___: [print(__import__('this').d.get(____, ____), end='', file=p) for ____ in ___])(__.stdout, setattr(__, 'stdout', open(_.devnull, 'w')), ___))(__import__('os'), __import__('sys'), 'frperg zrffntr')
night quarryBOT
#

@terse oriole :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 |   File "<string>", line 1, in <lambda>
004 | FileNotFoundError: [Errno 2] No such file or directory: '/dev/null'
terse oriole
#

this doesnt work on the bot

#

but I have no other way to suppress prints?

#

I wanted to use contextlib.redirect_stdout

floral meteor
#

make a dummy file object

golden finch
terse oriole
#

its a ROT 13 cipher using the dictionary in the this module

golden finch
#

oh

floral meteor
#

isn't that just a ceasar cipher?

terse oriole
#

ceasar is shift by 3

#

I think

floral meteor
#

I thought it was just any shift

golden finch
#

rot13 is special case of caesar

floral meteor
terse oriole
#

planning on onelining it with type

floral meteor
#

just all of the ones you use, except they do nothing except return the expected returns

terse oriole
#

uhh no the print function is using it...

floral meteor
#
class DevNull:
  readable=writable=True
  read=lambda s,n:'\0'*n
  write=lambda s,stuff:len(stuff)
  

something like that

terse oriole
#

!e

a=type("devnull", (), {"readable":True,"writable":True,"read":lambda s,n:'\0'*n,"write":lambda s,something:""})()
print("asd",file=a)
night quarryBOT
#

@terse oriole :warning: Your eval job has completed with return code 0.

[No output]
terse oriole
#

oh

#

that worked?

#

!e

(lambda _, __, ___: (lambda p, ____________________, ___: [print(__import__('this').d.get(____, ____), end='', file=p) for ____ in ___])(__.stdout, setattr(__, 'stdout', type("devnull", (), {"readable":True,"writable":True,"read":lambda s,n:'\0'*n,"write":lambda s,something:""})(), ___))(__import__('os'), __import__('sys'), 'frperg zrffntr')
floral meteor
#

XD

terse oriole
#

whoops

floral meteor
#

you don't need spaces after the commas

#

they just make it annoying

terse oriole
#

!e

(lambda _, __, ___: (lambda p, ____________________, ___: [print(__import__('this').d.get(____, ____), end='', file=p) for ____ in ___])(__.stdout, setattr(__, 'stdout', type("devnull", (), {"readable":True,"writable":True,"read":lambda s,n:'\0'*n,"write":lambda s,something:""})()), ___))(__import__('os'), __import__('sys'), 'frperg zrffntr')
night quarryBOT
#

@terse oriole :x: Your eval job has completed with return code 120.

001 | secret messageException ignored in: <__main__.devnull object at 0x7fa01cc6bc10>
002 | AttributeError: 'devnull' object has no attribute 'flush'
terse oriole
#

need more stuff

floral meteor
#

oops

#

just need flush=lambda s:None

terse oriole
#

yeah

floral meteor
#

and remove spaces after commas

terse oriole
#

!e

(lambda _,__,___:(lambda p, ____________________,___:[print(__import__('this').d.get(____,____),end='',file=p)for ____ in ___])(__.stdout, setattr(__,'stdout',type("devnull",(),{"readable":True,"writable":True,"read":lambda s,n:'\0'*n,"write":lambda s,something:"","flush":lambda a:None})()),___))(__import__('os'),__import__('sys'),'frperg zrffntr')
night quarryBOT
#

@terse oriole :white_check_mark: Your eval job has completed with return code 0.

secret message
terse oriole
#

perfect

#

!e

(lambda _,__,___:(lambda p, ____________________,___:[print(__import__('this').d.get(____,____),end='',file=p)for ____ in ___])(__.stdout, setattr(__,'stdout',type("devnull",(),{"readable":True,"writable":True,"read":lambda s,n:'\0'*n,"write":lambda s,something:"","flush":lambda a:None})()),___))(__import__('os'),__import__('sys'),'frperg zrffntr')
night quarryBOT
#

@terse oriole :white_check_mark: Your eval job has completed with return code 0.

secret message
terse oriole
#

I'm mostly learning esoteric python from this channel, still not that good at it though

floral meteor
#

I have a fun encryption method that takes an enormous amount of time to generate the key

terse oriole
#

hmm

floral meteor
#

the decrypter has a brainfuck interpreter built into it

terse oriole
#

about how enormous of a time?

floral meteor
#

on my nice beefy laptop, negligable.
on my older laptop, enough time to have a nap whilst generating the key

#

that is, with a 5 digit secret

terse oriole
#

oh

floral meteor
#

more digits, more thoncc

terse oriole
#

I can hear my pc fans spinning already

floral meteor
#
def generate(seed:int,key:int):return''.join([*map(lambda x:x**key,(*map(lambda x:int(x)<<1,str(seed)),))])
#

thoncc

#

returns a string, but the string can be interpreted as an abstractly large integer

#

encrypted message: an array of integers, each is usually under ten digits long.
decryption:

  • for each number in array
    • index the digit of the arbitrarily large integer at that position
    • append to new digit array
  • pass digit array as string to modified brainfuck interpreter
    • 8 selected digits are translated to brainfuck characters
    • the output from the equivalent of . character in brainfuck is printed or piped.
    • optionally, allow usage of the equivalent of , for an interactive encrypted io program.
#

encryption:

  • you have to write a brainfuck script, translate each character to matching digit, and randomly insert the unassigned digits.
  • for each "intfuck" digit:
    • choose a random position in the arbitrary integer
    • while the digit doesn't match, change position.
    • append index to array of encrypted data
#

it's overkill compared to ceasar shift

terse oriole
#

I-

floral meteor
#

!e but for simple message encryption I have this beautiful function

__annotations__=globals()
___:___ +'+-<>'=",.[]";
____:____//2 +1=(0x00for x in 100% yo_mamma is fat)
def code(
    _0:(str,"The code, preferably UTF-8")="",
    _1:(int,'architecture of target machine')=____
):
  if not(_0):return''
  if ord(max(_0))>1<<_1:raise RuntimeError(
    "Cannot encode "+max(_0)+" into character size "+str(_1)
  ) ;-D
  for _00 in['']:_01: (list, "mem::code")=[ord(_)for _ in str(_0)]
  _02:(list, "bf::mul-values")=[
    _ for _ in range((max(_01)+2)//10)if any([__//10==_ for __ in _01])
  ];_02+=(max(_01)//10 not in _02)*[max(_01)//10]
  _00+='+'*10+'[>'+'>'.join([_*'+'for _ in _02])+'<'*len(_02)+'-]>'
  _03:(int,"sys::pointer-shift state")=int()
  _04:(list,'mem::turing-machine')=[0]*len(_02)
  for _10 in _01:
    _11:(tuple, ("chop off last digit","last digit"))=_10.__divmod__(10)
    while _11[0]>_02[_03]:_03+=1;_00+='>';
    while _11[0]<_02[_03]:_03-=1;_00+='<';
    _12:(int,'cell_increment')= _11[1]-_04[_03]
    _00+={1<0:'+',0<1:'-'}[_12<0]*abs(_12)+'.'
    _04[_03]+=_12
  _05:(str, 'conflict')=___[4:6],___[6:8]
  for _2 in range(2):
    while _05[_2]in _00:_00=_00 .replace(_05[_2],'')
    while _05[_2][::-1]in _00:_00=_00.replace(_05[_2][::-1],'')
  return _00
print(code("Quack!\n"))
night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

++++++++++[>+>+++>++++++++>+++++++++>++++++++++>+++++++++++<<<<<<-]>>>+.>>>+++++++.<<+++++++.++.>+++++++.<<<+++.<.
terse oriole
#

quack

floral meteor
#

winking face

floral meteor
#

!e ```py
def code(
_0:(str,"The message, preferably UTF-8")="",
_1:(int,'architecture of target machine')=8
):
___ = ''.join(map(str,range(1,9)))
if not(_0):return''
if ord(max(_0))>1<<_1:raise RuntimeError(
"Cannot encode "+max(_0)+" into character size "+str(_1)
) ;-D
for _00 in['']:01: (list, "mem::code")=[ord()for _ in str(_0)]
_02:(list, "bf::mul-values")=[
_ for _ in range((max(01)+2)//10)if any([__//10== for __ in _01])
];_02+=(max(_01)//10 not in _02)[max(_01)//10]
00+='1'*10+'74'+'4'.join([
'1'for _ in _02])+'3'*len(_02)+'284'
_03:(int,"sys::pointer-shift state")=int()
_04:(list,'mem::turing-machine')=[0]*len(_02)
for _10 in _01:
_11:(tuple, ("chop off last digit","last digit"))=_10.divmod(10)
while _11[0]>_02[_03]:_03+=1;_00+='4';
while _11[0]<_02[_03]:_03-=1;_00+='3';
_12:(int,'cell_increment')= _11[1]-_04[_03]
_00+={1<0:'1',0<1:'2'}[12<0]*abs(12)+'5'
04[03]+=12
05:(str, 'conflict')=
[4:6],
[6:8]
for _2 in range(2):
while _05[_2]in _00:_00=_00 .replace(_05[_2],'')
while _05[_2][::-1]in _00:_00=_00.replace(_05[_2][::-1],'')
return _00
print(code("Roses are red, bananas are yellow, and my coffee is bitter, cold and black"))

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

111111111174111411114111111114111111111411111111114111111111114111111111111333333328444115444151111531545333331154441111111544253533335444445352533311115354441525442222533544533544111115333335444544253153333544444415335111111155422251111111153333535444544222222222532222222253333544441111111115445333333544411544153222222255255333354444111154111153333354442545415532222542253333535444154422253111111152222222253333544422544253533335444154111111115325115425
floral meteor
#

so how do I insert random 0s and 9s into that?

#

!e ```py
from random import randint
def random_insertion(number:str):
a,b=number.iter(),[]
try:
while 1:b+=next(a)if randint(0,5)else str(9*randint(0,1))
except StopIteration:return''.join(b).lstrip('0')
print(random_insertion("111111111174111411114111111114111111111411111111114111111111114111111111111333333328444115444151111531545333331154441111111544253533335444445352533311115354441525442222533544533544111115333335444544253153333544444415335111111155422251111111153333535444544222222222532222222253333544441111111115445333333544411544153222222255255333354444111154111153333354442545415532222542253333535444154422253111111152222222253333544422544253533335444154111111115325115425"))

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

11111110191917041114111141111111141111111119411019111119191411110110111199141111111111113393033303928444115440904151011153919954533339311544411111115044253533335440444535902530331111535444150254422225335944950335441111153333354445490425391533330540404944949153035111111155402022511110111153333535044454422222220022593220922022202053333549494411191111115445333393354441915441532922992222552553333540944491111541111593903393035444254954091595322220054225333353544415442292593911111101522222222533330054442254429535333354449154111911111532511594250
floral meteor
#

that actually worked

floral meteor
#

I think this might be hard to decrypt

#

unless you have the seed and pin

#

and it's so slow you need waitbars

#
def decrypt(filename,seed:int,key:int):
  with open(filename)as file:data='array='+file.read()
  with open('temp.py','w')as f:f.write(data)
  from temp import array
  __import__('os').remove('temp.py')
  print("generating...")
  abstract_integer = generate(seed,key)
  print("decrypting...")
  del key
  numbers = [int(abstract_integer[int(this)])for this in array]
  return[intfuck(numbers),print("decryption complete.")][0]

def encrypt(name:str,location:str,message:str,seed:int,key:int):
  fn = location+__import__('os').sep+name+'.txt'
  code = unfuck(message)
  print('generating...')
  abstract_integer = generate(seed,key)
  limit = len(abstract_integer)-1
  assert all([str(this)in abstract_integer for this in set(code)])
  print("encrypting...")
  del key
  def ff(ie):
    i,e=ie
    pos = randint(0,limit)
    while str(e)!=abstract_integer[pos]:pos-=1;pos%=limit
    code[i]=pos
  *map(ff,[*enumerate(code)]),
  with open(fn,'w')as f:f.write(str(code))
  print("encryption complete.")
vale tangle
#
for i in "etbj":    print(chr(ord(i)+1))
#

wait DONT EXECUTE THAT

finite blaze
#

!e for i in "etbj": print(chr(ord(i)+1))

night quarryBOT
#

@finite blaze :white_check_mark: Your eval job has completed with return code 0.

001 | f
002 | u
003 | c
004 | k
finite blaze
#

D:

sly root
#

now this

__try:__asm|[
  format ( MZ ),
  push   ( cs ),
  pop    ( ds ),
  mov    ( ah| 9 ),
  mov    ( dx| hello ),
  int    ( 21 ),
  mov    ( ax| 0x4C00 ),
  int    ( 21 ),
  hello| ( db| 'Hello world!' | 24 )  
]
__except:(Exception)|[
  nop
]

parses to

__try __asm | [format(MZ), push(cs), pop(ds), mov(ah | 9), mov(dx | hello), int(21), mov(ax | 19456), int(21), hello | (db | 'Hello world!' | 24)]
__except Exception | [nop]
#

doing something like inline asm from c++ (idk why when my main lang is c++ but why not)

sly root
vale tangle
#

!e __try:__asm|[
format ( MZ ),
push ( cs ),
pop ( ds ),
mov ( ah| 9 ),
mov ( dx| hello ),
int ( 21 ),
mov ( ax| 0x4C00 ),
int ( 21 ),
hello| ( db| 'Hello world!' | 24 )
]
__except:(Exception)|[
nop
]

vale tangle
sly root
#

here's the code that makes it work:

from __future__ import annotations

@lambda c:c()
class __annotations__:
 def __setitem__(s,k,v):
  match k:
   case "__try":
    s._k=k
    s._v=v
   case "__except":
    print(s._k,s._v)
    print(k,v)
   case "__asm":std.__asm(k,v)
   case "std":std.__getattr__(k)(v)
   case "__for":
    s.cond=v.split(",")[1].strip()
    s.var=v.split(",")[0].strip("(")
    globals().update({s.var:0})
   case "_":
    c=v.strip("{").strip("}").strip().split(", ")
    cs="\n".join(st.strip("'")for st in code)
    while eval(self.cond):
     exec(cs);globals()[s.var]+=1
   case _:pass

@type.__call__
class std:
 def __asm(s,k,i):
  _i=i.split("|")
  t,_c=_i[0].strip(),[expr.strip()for expr in _i[-1].strip()[1:][:-1].split(",")]
  print(t,_c)
 class std:
  def __init__(s,i):
   _cs=i.split("|")
   _fn=_cs[0].strip()
   _arg="".join([arg.strip().replace("+endl","\n")for arg in _cs[1:]])
   s.__getattribute__(_fn)(_arg)
  def cout(s,i):print(i)
 def __getattr__(s,a):
  return s.__getattribute__(a.replace("_annotations__","_std"))
#

but still wip

sly root
#

!e ```py
from future import annotations
@lambda c:c()
class annotations:
def setitem(s,k,v):
match k:
case "__try":s._k,s._v=k,v
case "__except":print(s._k,s.v);print(k,v)
case "__asm":std.__asm(k,v)
case "std":std.getattr(k)(v)
case "__for":s.cond,s.var=v.split(",")[1].strip(),v.split(",")[0].strip("(");globals().update({s.var:0})
case "
":
c=v.strip("{").strip("}").strip().split(", ");cs="\n".join(st.strip("'")for st in c)
while eval(self.cond):exec(cs);globals()[s.var]+=1
case _:pass
@type.call
class std:
def __asm(s,k,i):
_i=i.split("|")
t,_c=_i[0].strip(),[expr.strip()for expr in _i[-1].strip()[1:][:-1].split(",")]
print(t,_c)
class std:
def init(s,i):
_cs=i.split("|")
_fn=_cs[0].strip()
_arg="".join([arg.strip().replace("+endl","\n")for arg in _cs[1:]])
s.getattribute(_fn)(arg)
def cout(s,i):print(i)
def getattr(s,a):
return s.getattribute(a.replace("annotations
","_std"))

__try:__asm|[
format ( MZ ),
push ( cs ),
pop ( ds ),
mov ( ah| 9 ),
mov ( dx| hello ),
int ( 21 ),
mov ( ax| 0x4C00 ),
int ( 21 ),
hello| ( db ( 'Hello world!' ) | 24 )
]
__except:(AssertionError)|[
nop
]

night quarryBOT
#

@sly root :white_check_mark: Your eval job has completed with return code 0.

001 | __try __asm | [format(MZ), push(cs), pop(ds), mov(ah | 9), mov(dx | hello), int(21), mov(ax | 19456), int(21), hello | (db('Hello world!') | 24)]
002 | __except AssertionError | [nop]
outer surge
#

!e ```
from types import FunctionType
a = (x for x in [1])
list(FunctionType(a.gi_code, {})(0))

night quarryBOT
#

@outer surge :warning: Your eval job has completed with return code 139 (SIGSEGV).

[No output]
outer surge
#

I wonder if you could do fun things with ctypes on the evaluator

#

I hope it's sandboxed

sly root
sly root
#

"call stack"\™

0 ['movr', '3']                                      1 ['add', '48']                                      2 ['rprint', 'rprint']                               48                                                   3 ['fprint', 'fprint']                               0                                                    4 ['add', '12']                                      5 ['loop', '71']                                     6 ['movr', '1']                                      7 ['add', '3']                                         8 ['end']                                           unrecognised instruction end```
severe canyon
#

trademark and all?

#

damn

split salmon
#

!e print(dircompile("a=1",'','exec')))

sly root
split salmon
#

!e print(dircompile("a=1",'','exec')))

#

!e print(dircompile("a=1",'','exec'))

night quarryBOT
#

@split salmon :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | NameError: name 'dircompile' is not defined. Did you mean: 'compile'?
split salmon
#

!e print(dir(compile("a=1",'','exec')))

night quarryBOT
#

@split salmon :white_check_mark: Your eval job has completed with return code 0.

['__class__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'co_argcount', 'co_cellvars', 'co_code', 'co_consts', 'co_filename', 'co_firstlineno', 'co_flags', 'co_freevars', 'co_kwonlyargcount', 'co_lines', 'co_linetable', 'co_lnotab', 'co_name', 'co_names', 'co_nlocals', 'co_posonlyargcount', 'co_stacksize', 'co_varnames', 'replace']
sly root
#

added argument type cast

#
0 ['movr', 3]                                        1 ['add', 48]                                        2 ['rpr', 'rpr']                                     48                                                   3 ['fpr', 'fpr']                                     0                                                    4 ['add', 12]                                        5 ['loop', 71]                                       6 ['movr', '1']                                      7 ['add', '3']                                       8 ['nop', 'nop']                                     9 ['end', 'end']
#

now i need to update the interpreter to make it work with loops

vague cairn
earnest wing
#

Yep printf programming is fun

sly root
#

lol

#
__struct:human|(
  name| str,
   age| int,
  born| datetime.datetime
)
print(human)```
sly root
floral meteor
#

I wanna make an esolang that compiles to brainfuck.

#

Just to make it easier to write brainfuck

#

I'm the interpreter, I would write brainfuck to end writing brainfuck

#

*compiler

sly root
#

but problem is the compiler itself

sly root
#

so i was using .split

#

now I'm trying to migrate that code to sly/ply

#

its easy to parse something like this

__struct:human|(
  name| str,
   age| int,
  born| datetime.datetime
)``` because there's only one thing (`|`) you can split that text with
#

and then just iterate over the list

#

but its not easy to parse this

__try:__brainfuck|(
   movr| 3,
    add| 112,
     fpr,
    add| 12,
   loop| 71 |[
        movr| 1,
         add| 3,
        loop| 4 |[
            movl| 3,
             mul| 77
        ]
   ],
)
__except:(Exception)|(
  print| "Oopsie"
)```
sly root
# sly root but its not easy to parse this ```py __try:__brainfuck|( movr| 3, add| 11...

lexed

LexToken(INSTR,'movr',1,0)                           LexToken(SPACE,' ',1,4)                              LexToken(ARG,'|',1,5)                                LexToken(SPACE,' ',1,6)                              LexToken(NUMBER,3,1,7)                               LexToken(COMMA,',',1,8)                              LexToken(SPACE,' ',1,9)                              LexToken(INSTR,'add',1,10)                           LexToken(SPACE,' ',1,13)                             LexToken(ARG,'|',1,14)                               LexToken(SPACE,' ',1,15)                             LexToken(NUMBER,112,1,16)                            LexToken(COMMA,',',1,19)                             LexToken(SPACE,' ',1,20)                             LexToken(INSTR,'fpr',1,21)                           LexToken(COMMA,',',1,24)                             LexToken(SPACE,' ',1,25)                             LexToken(INSTR,'add',1,26)                           LexToken(SPACE,' ',1,29)                             LexToken(ARG,'|',1,30)                               LexToken(SPACE,' ',1,31)                             LexToken(NUMBER,12,1,32)                             LexToken(COMMA,',',1,34)                             LexToken(SPACE,' ',1,35)                             LexToken(INSTR,'loop',1,36)                          LexToken(SPACE,' ',1,40)                             LexToken(ARG,'|',1,41)                               LexToken(SPACE,' ',1,42)                             LexToken(NUMBER,71,1,43)                             LexToken(SPACE,' ',1,45)                             LexToken(ARG,'|',1,46)                               LexToken(SPACE,' ',1,47)                             LexToken(LOOP_START,'(',1,48)                        LexToken(INSTR,'movr',1,49)                          LexToken(SPACE,' ',1,53)                             LexToken(ARG,'|',1,54)                               LexToken(SPACE,' ',1,55)                             ```
#
LexToken(NUMBER,1,1,56)                              LexToken(COMMA,',',1,57)                             LexToken(SPACE,' ',1,58)                             LexToken(INSTR,'add',1,59)                           LexToken(SPACE,' ',1,62)                             LexToken(ARG,'|',1,63)                               LexToken(SPACE,' ',1,64)                             LexToken(NUMBER,3,1,65)                              LexToken(COMMA,',',1,66)                             LexToken(SPACE,' ',1,67)                             LexToken(INSTR,'loop',1,68)                          LexToken(SPACE,' ',1,72)                             LexToken(ARG,'|',1,73)                               LexToken(SPACE,' ',1,74)                             LexToken(NUMBER,4,1,75)                              LexToken(SPACE,' ',1,76)                             LexToken(ARG,'|',1,77)                               LexToken(SPACE,' ',1,78)                             LexToken(LOOP_START,'(',1,79)                        LexToken(INSTR,'movl',1,80)                          LexToken(SPACE,' ',1,84)                             LexToken(ARG,'|',1,85)                               LexToken(SPACE,' ',1,86)                             LexToken(NUMBER,3,1,87)                              LexToken(COMMA,',',1,88)                             LexToken(SPACE,' ',1,89)                             LexToken(INSTR,'mul',1,90)                           LexToken(SPACE,' ',1,93)                             LexToken(ARG,'|',1,94)                               LexToken(SPACE,' ',1,95)                             LexToken(NUMBER,77,1,96)                             LexToken(LOOP_END,')',1,98)                          LexToken(LOOP_END,')',1,99)```
sly root
#

some progress

#

input:

__brainfuck:(
  movl| 3,
  loop| 30 |(
        add| 7,
       movr| 2
  ),
)
#

output:

LexToken(SHIFT_LEFT,'movl',2,1)                      LexToken(ARG,'|',2,5)                                LexToken(NUM,3,2,7)                                  LexToken(COMMA,',',2,8)                              LexToken(LOOP,'loop',3,10)                           LexToken(ARG,'|',3,14)                               LexToken(NUM,30,3,16)                                LexToken(ARG,'|',3,19)                               LexToken(LPAREN,'(',3,20)                            LexToken(PLUS,'add',4,28)                            LexToken(ARG,'|',4,31)                               LexToken(NUM,7,4,33)                                 LexToken(COMMA,',',4,34)                             LexToken(SHIFT_RIGHT,'movr',5,41)                    LexToken(ARG,'|',5,45)                               LexToken(NUM,2,5,47)                                 LexToken(RPAREN,')',6,49)```
fleet bridge
#

movl 3 equal to <<< in bf?

sly root
#

lexer is done, i guess

#

now parser and so on

vale tangle
#

!e

import random,time
class Imposter:
  def __init__(self,sus):
    self.sus = sus
theimposter = Imposter(False)
r = 0
while not theimposter.sus:
  if random.randint(0,10):
    r+=1
    time.sleep(0.1)
    continue
  theimposter.sus = True
print(f"The imposter was acting kinda sus and was thrown away on the {r} round.")
del theimposter # throw him outta here
night quarryBOT
#

@vale tangle :white_check_mark: Your eval job has completed with return code 0.

The imposter was acting kinda sus and was thrown away on the 38 round.
untold mountain
#

sus

vale tangle
#

!e

i = 0
while True:
  i+=1
  print(i)
night quarryBOT
#

@vale tangle :x: Your eval job has completed with return code 143 (SIGTERM).

001 | 1
002 | 2
003 | 3
004 | 4
005 | 5
006 | 6
007 | 7
008 | 8
009 | 9
010 | 10
011 | 11
... (truncated - too many lines)

Full output: too long to upload

severe canyon
vale tangle
#

!e

import random,time
class Imposter:
  def __init__(self,sus):
    self.sus = sus
theimposter = Imposter(False)
r = 0
while not theimposter.sus:
  if random.randint(0,10):
    r+=1
    time.sleep(0.1)
    continue
  theimposter.sus = True
print(f"The imposter was acting kinda sus and was thrown away on the {r} round.")
del theimposter # throw him outta here
night quarryBOT
#

@vale tangle :white_check_mark: Your eval job has completed with return code 0.

The imposter was acting kinda sus and was thrown away on the 17 round.
safe sinew
#

!e

print(len("​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​"))
night quarryBOT
#

@safe sinew :white_check_mark: Your eval job has completed with return code 0.

60
safe sinew
#

!e

hi
night quarryBOT
#

@safe sinew :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | NameError: name 'hi' is not defined
golden finch
#

@floral meteor can you teach me your cursed bf interpreters?

#

I love reading them but don't understand most

floral meteor
#

I've memorized one of them

floral meteor
#

!e Here's a version I don't think I've tried before

class brainfuck:
  def __iadd__(s, n):
    s.a[s.i] += n
    s.a[s.i] %= 256
    return s
  def __str__(s):
    return chr(s.a[s.i])
  def __bool__(s):
    return bool(s.a[s.i])
  def __init__(s, c):
    s.a=__import__("collections").defaultdict(int)
    s.i=0
    s.error=s.run(c)
  def run(s, c):
    s.t=p=0
    while 0<=p<=len(c)-1:
      if s.t:s.t+=(c[p]=='[')-(c[p]==']')
      else:getattr(s,{
        '+':'add', '-':'sub',
        '<':'left','>':'rite',
        '.':'dot', ',':'com',
        '[':'loop',']':'endl'
      }.get(c[p],'nop'))()
      p+=1-2*(s.t<0)
    return+bool(s.t)
  memory=property(lambda s:[*(
      lambda a:[s.a[_]for _ in range(min(a),max(a))]and s.a
    )([*s.a.keys()]).values()],__iadd__)
  def add(s):s += 1
  def sub(s):s +=-1
  def left(s):s.i -= 1
  def rite(s):s.i += 1
  def dot(s):print(end=str(s))
  def com(s):s.a[s.i]=0;s+=ord(__import__('sys').stdout.read(1))
  def loop(s):s.t+=not s
  def endl(s):s.t-=bool(s)
  def nop(*_):...
a = brainfuck("++++++++++[>+>+++>++++++++>+++++++++>++++++++++>+++++++++++<<<<<<-]>>>+.>>>+++++++.<<+++++++.++.>+++++++.<<<+++.<.")
print(a.memory)
night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

001 | Quack!
002 | [0, 10, 33, 81, 99, 107, 117]
floral meteor
#

!e one liner with only one variable name. ```py
(lambda :(lambda :([0 for [6]['+']in[lambda:[([2],0)for [1][[2]]in[([1][[2]]+1)%256]][0]]for [6]['-']in[lambda:[([2],0)for [1][[2]]in[([1][[2]]-1)%256]][0]]for [6]['<']in[lambda:([2]-1,0)]for [6]['>']in[lambda:([2]+1,0)]for [6]['.']in[lambda:print(end=chr([1][[2]]))or([2],0)]for [6][',']in[lambda:[([2],0)for [1][[2]]in[ord(5)]][0]]for [6]['[']in[lambda:([2],not [1][[2]])]for [6][']']in[lambda:([2],-bool([1][[2]]))]],{[[[0 for [3]in[[3]+([0][[4]]=='[')-([0][[4]]==']')]]if [3]else[0 for [2:4]in[[6].get(([0]+'\0')[[4]],lambda:([2],0))()]]]for [4]in[1+[4]-2*([3]<0)]]and()for{}[0]in iter(lambda:0<=[4]<len([0]),False)}, not not [3] )[-1])([' '+,import('collections').defaultdict(int),0,0,0,import("sys").stdin.read,{}]))("++++++++++[>+>+++>++++++++>+++++++++>++++++++++>+++++++++++<<<<<<-]>>>+.>>>+++++++.<<+++++++.++.>+++++++.<<<+++.<.")

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

Quack!
terse oriole
#

Well guess you're making a lot of code that outputs quack now huh

finite blaze
pure dew
near gust
floral meteor
#

that link name XD

floral meteor
floral meteor
#

I'm conceptualizing the compiler currently, before I start writing it.

golden finch
#

at any rate, hello

golden finch
formal bridge
#

What does esoteric python mean

finite blaze
#

this

sly root
#

!e ```py
pointer=0;memory=[0 for i in range(21)]
def _(_0=(list,'instruction to interpet')):
B='memory';A='pointer';_1=_0[0];_2=_0[1]
match _1:
case'add':globals()[B][globals()[A]]+=_2
case'sub':globals()[B][globals()[A]]-=_2
case'mul':globals()[B][globals()[A]]*=_2
case'mmul':globals()[B][globals()[A]]@=_2
case'div':globals()[B][globals()[A]]/=_2
case'rdiv':globals()[B][globals()[A]]//=_2
case'pow':globals()[B][globals()[A]]^=_2
case'mod':globals()[B][globals()[A]]%=_2
case'movl':globals()[A]-=_2
case'movr':globals()[A]+=_2
case'rst':globals()[A]=0
case'ind':print(globals()[A])
case'ret':print(chr(globals()[B][globals()[A]]))
case'mret':print(''.join([chr(globals()[B][i])for i in range(_2)]))
case'dump':print(globals()[B])
case'loop':print('loops are not implemented')
case'endl':0
case'nop':0
case _:0

_(['movr', 2])
_(['ind', None])
_(['add', 113])
_(['ret', None])
_(['dump', None])

night quarryBOT
#

@sly root :white_check_mark: Your eval job has completed with return code 0.

001 | 2
002 | q
003 | [0, 0, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
sly root
#

!e ```py
from future import annotations
pointer=0;memory=[0 for i in range(21)]
def _(_0=(list,'instruction to interpet')):
B='memory';A='pointer';_1=_0[0];_2=_0[1]
match _1:
case'add':globals()[B][globals()[A]]+=_2
case'sub':globals()[B][globals()[A]]-=_2
case'mul':globals()[B][globals()[A]]*=_2
case'mmul':globals()[B][globals()[A]]@=_2
case'div':globals()[B][globals()[A]]/=_2
case'rdiv':globals()[B][globals()[A]]//=_2
case'pow':globals()[B][globals()[A]]^=_2
case'mod':globals()[B][globals()[A]]%=_2
case'movl':globals()[A]-=_2
case'movr':globals()[A]+=_2
case'rst':globals()[A]=0
case'ind':print(globals()[A])
case'ret':print(chr(globals()[B][globals()[A]]))
case'mret':print(''.join([chr(globals()[B][i])for i in range(_2)]))
case'dump':print(globals()[B])
case'loop':print('loops are not implemented')
case'endl':0
case'nop':0
case _:0
@lambda c:c()
class annotations:
def setitem(s,k,v):
if'__brainfuck'in k:
instructions=v[1:][:-1]
_0=instructions.replace('(','(,')
_1=_0.replace(')',',)')
_2=_1.split(_A)
_3=[instruction.strip()for instruction in _2]
_4=[instruction.replace(' ','')for instruction in _3]
_5='\n'.join(_4)
_6=[]
for instruction in _5.splitlines():
_7=instruction.split('|')
if len(_7)>1:
_6.append([_7[0],int(_7[1])if _7[1].isnumeric()else _7[1]])
elif not _7[0]=='':
_6.append([_7[0],None])
for _instr in _6:
_(_instr)
else:0
__brainfuck:(
add| 104, movr| 1,
add| 101, movr| 1,
add| 108, movr| 1,
add| 108, movr| 1,
add| 111, movr| 1,
add| 32, movr| 1,
add| 119, movr| 1,
add| 111, movr| 1,
add| 114, movr| 1,
add| 108, movr| 1,
add| 100,
aret| 11,
loop| 3 |(
movr| 26,
),
ind,
dump,
)

night quarryBOT
#

@sly root :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 46, in <module>
003 |   File "<string>", line 32, in __setitem__
004 | NameError: name '_A' is not defined. Did you mean: '_0'?
formal bridge
sly root
#

!e ```py
from future import annotations
pointer=0;memory=[0 for i in range(301)]
def _(_0=(list,'instruction to interpet')):
_1=_0[0];_2=_0[1]
match _1:
case'add':globals()['memory'][globals()['pointer']]+=_2
case'sub':globals()['memory'][globals()['pointer']]-=_2
case'mul':globals()['memory'][globals()['pointer']]*=_2
case'mmul':globals()['memory'][globals()['pointer']]@=_2
case'div':globals()['memory'][globals()['pointer']]/=_2
case'rdiv':globals()['memory'][globals()['pointer']]//=_2
case'pow':globals()['memory'][globals()['pointer']]^=_2
case'mod':globals()['memory'][globals()['pointer']]%=_2
case'movl':globals()['pointer']-=_2
case'movr':globals()['pointer']+=_2
case'rst':globals()['pointer']=0
case'ind':print(globals()['pointer'])
case'ret':print(chr(globals()['memory'][globals()['pointer']]))
case'mret':print(''.join([chr(globals()['memory'][i])for i in range(_2)]))
case'dump':print(globals()['memory'])
case'loop':print('loops are not implemented')
case'endl':0
case'nop':0
case _:0
@lambda c:c()
class annotations:
def setitem(s,k,v):
if'__brainfuck'in k:
instructions=v[1:][:-1]
_0=instructions.replace('(','(,')
_1=_0.replace(')',',)')
_2=_1.split(',')
_3=[instruction.strip()for instruction in _2]
_4=[instruction.replace(' ','')for instruction in _3]
_5='\n'.join(_4)
_6=[]
for instruction in _5.splitlines():
_7=instruction.split('|')
if len(_7)>1:
_6.append([_7[0],int(_7[1])if _7[1].isnumeric()else _7[1]])
elif not _7[0]=='':
_6.append([_7[0],None])
for _instr in 6:(_instr)

__brainfuck:(
add| 104, movr| 1,
add| 101, movr| 1,
add| 108, movr| 1,
add| 108, movr| 1,
add| 111, movr| 1,
add| 32, movr| 1,
add| 119, movr| 1,
add| 111, movr| 1,
add| 114, movr| 1,
add| 108, movr| 1,
add| 100,
mret| 11,
ind,
loop| 3 |(
movr| 26,
),
ind,
)```

night quarryBOT
#

@sly root :white_check_mark: Your eval job has completed with return code 0.

001 | hello world
002 | 10
003 | loops are not implemented
004 | 36
floral meteor
#

lol loops are not implemented. That's kinda essential

#

I wonder where you got this style from?

def _(_0=(list,'instruction to interpet')):
  ...
#

looks similar to this

def code(
    _0:(str,"The message, preferably UTF-8")="",
    _1:(int,'architecture of target machine')=8
):

XD

#

I like the annotations usage though

#

I just can't help but

for _1,_2 in _0:
  match _1:
    .
    :