Forwarded from Zac
Language:
Source:
Result:
py3
Source:
mc,ctemp,cmax,current,c=[],[],5,0,0
members=[*'abcdefghijklmn']
while current < len(members):
c=0
for m in members[current:]:
if c==cmax:break
ctemp.append(m)
c+=1
current+=1
mc.append(ctemp)
ctemp=[]
print(mc)
Result:
[['a', 'b', 'c', 'd', 'e'], ['f', 'g', 'h', 'i', 'j'], ['k', 'l', 'm', 'n']]
Language:
Source:
Result:
py3
Source:
def turn_down():return
turn_down_for = \
[turn_down() for wat in range(5)]
print(*turn_down_for, " Batman!", sep='')
Result:
NoneNoneNoneNoneNone Batman!
๐คก1
Forwarded from Zac
Language:
Source:
Result:
py3
Source:
from datetime import datetime,timedelta
import math
p,m="โ","โ"
n=datetime.now()
st,en=datetime(n.year,1,1), datetime(n.year+1,1,1)-timedelta(days=1)
tot,el=en-st,n-st
pe=(el/tot)*100
elp=int(math.ceil(pe)*0.17)
print(p*elp,m*(17-elp)," ",int(pe),"%",sep="")
Result:
โโโโโโโโโโโโโโโโโ 69%
Forwarded from Zac
from datetime import datetime,timedelta
import math
# https://stackoverflow.com/a/15537393
def remap(x, oMin, oMax, nMin, nMax):
if oMin == oMax:
print("Warning: Zero input range")
return None
if nMin == nMax:
print("Warning: Zero output range")
return None
reverseInput = False
oldMin = min(oMin, oMax)
oldMax = max(oMin, oMax)
if not oldMin == oMin:
reverseInput = True
reverseOutput = False
newMin = min(nMin, nMax)
newMax = max(nMin, nMax)
if not newMin == nMin :
reverseOutput = True
portion = (x-oldMin)*(newMax-newMin)/(oldMax-oldMin)
if reverseInput:
portion = (oldMax-x)*(newMax-newMin)/(oldMax-oldMin)
result = portion + newMin
if reverseOutput:
result = newMax - portion
return result
p,m="โ","โ"
n=datetime.now()
st,en=datetime(n.year,1,1), datetime(n.year+1,1,1)-timedelta(days=1)
tot,el=en-st,n-st
pe=(el/tot)*100
elp=int(math.ceil(pe)*0.16)
sc_pe= math.ceil(remap(pe, 1, 100, 1, 14000/23))
print("{}{} {}% ({}%)".format(p*elp,m*(16-elp),int(sc_pe),int(pe)))Forwarded from Deleted Account
Result:
โโโโโโโโโโโโโโโโ 420% (69%)
Forwarded from Jonatan [active currently]
Language:
Source:
Result:
py3
Source:
def x():
yield (yield (yield))
x = x()
next(x)
print(x.send('a'))
Result:
a
Language:
Source:
Result:
py3
Source:
input_text = 'hello bobin'
mapped = dict(list(zip(range(65,90), range(0x1F1E6,0x1F1FF)))+[(32,32)])
gen = [chr(mapped[ord(x.upper())]) for x in input_text]
print(*gen,sep='\u200b')
Result:
๐ญโ๐ชโ๐ฑโ๐ฑโ๐ดโ โ๐งโ๐ดโ๐งโ๐ฎโ๐ณ
Language:
Source:
Result:
py3
Source:
input_text = '#hello 123\n bobin!!! \n:D'
r=range(65,90)
mapped = dict(list(zip(r, range(0x1F1E6,0x1F1FF)))+[(32,32)])
gen = [chr(mapped[ord(x)]) if ord(x) in r else x for x in input_text.upper()]
print(*gen,sep='\u200b')
Result:
#โ๐ญโ๐ชโ๐ฑโ๐ฑโ๐ดโ โ1โ2โ3โ
โ โ๐งโ๐ดโ๐งโ๐ฎโ๐ณโ!โ!โ!โ โ โ โ
โ:โ๐ฉ
Language:
Source:
Result:
py3
Source:
male = "โ๏ธ"
female = "โ๏ธ"
man = "๐โโ๏ธ"
trans = man.translate(man.maketrans(male, female))
neutral = trans[:-3]
print(man, trans, neutral, sep="\n")
Result:
๐โโ๏ธ
๐โโ๏ธ
๐
Language:
Source:
Result:
py3
Source:
man = '๐โโ๏ธ'
_=man.translate
trans = _(\
man.maketrans('โ๏ธ','โ๏ธ'))
neutral = trans[:-3]
print(man, trans, neutral)
Result:
๐โโ๏ธ ๐โโ๏ธ ๐
import re
from string import printable as pr
p=pr[10:]+'0123456789'
extra = len(p) % 16
if extra > 0:
p = p + ("\x00" * (16 - extra))
spl = re.findall("(.{1,16})", p, flags=re.DOTALL)[0]
inp = "helloo"
jnd=''.join([str(hex(spl.find(x))).split('x')[1] for x in inp])
spl2= re.findall("(.{2})", jnd, flags=re.DOTALL)
jnd2=''.join([chr(int(x, 16)) for x in spl2])
print('Input text: ', inp, '\nCompressed: ', jnd2, '\nSavings: ', int((len(inp)/len(jnd2))*100), '%', sep='')
djnd=[str(hex(ord(x))).split('x')[1] for x in jnd2]
dcd=[spl[int(x[0],16)]+spl[int(x[1],16)] for x in djnd]
print('Decompressed: ', *dcd, sep='')Language:
Source:
Result:
py3
Source:
class Boat():
def __init__(s):pass
@staticmethod
def build():
return " ๐ฉ\n\___/"
boat = Boat()
print(boat.build())
Result:
๐ฉ
\___/
Language:
Source:
Result:
py3
Source:
a,x,y,z,j,k,b,m=1,5.5,0,2,3,5,4,0
while y<((a*a)/z+(a*z))*(x*z)*j+k:y+=a;
while m<(b*((a+a)*j*j-a)):m+=b;
print(''.join(map(chr,[int(m*((int(str(k+a)+str(j)+"0")+a)*j+(a/b)))])))
Result:
๐ฅ
๐ข1
Forwarded from Zac
Language:
Source:
Result:
py3
Source:
from string import printable
fancy_code = """๐ ๐๐พ๐๐("๐ป๐๐๐๐, ๐๐๐๐๐น!")"""
d = dict(zip("""๐ข๐ฃ๐ค๐ฅ๐ฆ๐ง๐จ๐ฉ๐ช๐ซ๐ถ๐ท๐ธ๐น๐๐ป๐๐ฝ๐พ๐ฟ๐๐๐๐๐๐ ๐๐๐๐๐๐๐๐๐๐๐๐ต๐๐๐ธ๐น๐ข๐ป๐ผ๐ฅ๐ฆ๐ฟ๐๐ฉ๐ช๐ซ๐ฌ๐ ๐ฎ๐ฏ๐ฐ๐ฑ๐ฒ๐ณ๐ด๐ต""", printable))
exec(''.join([d[x] if x in d else x for x in fancy_code]))
Result:
Hello, world!
Input:
Output:
Printed:
``
"".join(sorted("Zac", key=ord))Output:
ZacPrinted:
``
Forwarded from davide
Language:
Source:
Result:
py3
Source:
f,r,a,n,c,e = (*"franc"#e
,print)
a = "".join((f,r,a))
f;r;a;n;c;e(
fr"{a}nce"
)
Result:
france
Forwarded from davide
Language:
Source:
Result:
py3
Source:
noreply,gmail=type("",(type,),{"__matmul__":lambda*_:print(f"{_[0].__name__}@{_[1]}")})("noreply",(),{}),type("",(),{"com":"gmail.com"})
noreply@gmail.comResult:
noreply@gmail.com
Forwarded from Zac
Language:
Source:
Result:
py3
Source:
class _():
def __init__(__,_):__(_)
def __call__(__,_):print(_);return __
_('a')('b')('c')('d')('e')('f')
Result:
a
b
c
d
e
f
Forwarded from use std::twit::๐ฉ::*; [now with more utc+2/3]
Exec Source:
Result:
code = """class _():
def __init__(__,_):__(_)
def _(__,_=''):return __(' '+_)
def __call__(__,_):print(_, end='');return __"""
text = str(code)
final = f"""{code}\n_{''.join([f"({repr(c)})" if c!=' ' else "._()" for c in text.strip()])}"""
print(final, '\n')
exec(final)
return AsyncNone
Result:
class _():
def __init__(__,_):__(_)
def _(__,_=''):return __(' '+_)
def __call__(__,_):print(_, end='');return __
_('c')('l')('a')('s')('s')._()('_')('(')(')')(':')('\n')._()._()._()._()('d')('e')('f')._()('_')('_')('i')('n')('i')('t')('_')('_')('(')('_')('_')(',')('_')(')')(':')('_')('_')('(')('_')(')')('\n')._()._()._()._()('d')('e')('f')._()('_')('(')('_')('_')(',')('_')('=')("'")("'")(')')(':')('r')('e')('t')('u')('r')('n')._()('_')('_')('(')("'")._()("'")('+')('_')(')')('\n')._()._()._()._()('d')('e')('f')._()('_')('_')('c')('a')('l')('l')('_')('_')('(')('_')('_')(',')('_')(')')(':')('p')('r')('i')('n')('t')('(')('_')(',')._()('e')('n')('d')('=')("'")("'")(')')(';')('r')('e')('t')('u')('r')('n')._()('_')('_')
class _():
def __init__(__,_):__(_)
def _(__,_=''):return __(' '+_)
def __call__(__,_):print(_, end='');return __
๐คฏ1
Dyslexia Regex
Minified version (only PCREBot compatible):
V = Vowel
C = Consonant
===VVCVC?= or
==?VVCVC?=
==?VVC?==
Minified version (only PCREBot compatible):
s/(?i)(((?<V>[aeiou]|(?<![aeiou])y(?![aeiou]))|(\B\g<V>))(\g<V>)(?<C>[^aeiouy .,'"\n()\[\]{}])((\g<V>)([^aeiouy .,]\B))|(\B(\g<V>)|(\B\g<V>))(\g<V>)([^aeiouy .,]))|((\g<C>)(\g<C>)(\g<V>)(\g<V>))|(\b\g<C>)(\g<V>)(\g<V>)(\g<C>\b)/\3\6\5\9\8\11\14\13\16\18\17\19\20\21\23\22
Engine: PCRE
Flags: global, ignore-case
Parts of the above pattern commented:V = Vowel
C = Consonant
===VVCVC?= or
==?VVCVC?=
(((?<VOWEL>[aeiou]|(?<![aeiou])y(?![aeiou]))|(\B\g<VOWEL>))(\g<VOWEL>)(?<CONS>[^aeiouy .,'"\n()\[\]{}])((\g<VOWEL>)([^aeiouy .,]\B))|
===VVC?== or ==?VVC?==
(\B(\g<VOWEL>)|(\B\g<VOWEL>))(\g<VOWEL>)([^aeiouy .,]))|===CCVV===
((\g<CONS>)(\g<CONS>)(\g<VOWEL>)(\g<VOWEL>))|CVVC
(\b\g<CONS>)(\g<VOWEL>)(\g<VOWEL>)(\g<CONS>\b)Substitution:
$3$6$5$9$8$11$14$13$16$18$17$19$20$21$23$22Example text:
usually a rounding subroutineResult:
usulaly a ronuding suborutines/(?i)(((?<V>[aeiou]|(?<![aeiou])y(?![aeiou]))|(\B\g<V>))(\g<V>)(?<C>[^aeiouy .,'"\n()\[\]{}])((\g<V>)([^aeiouy .,]\B))|(\B(\g<V>)|(\B\g<V>))(\g<V>)([^aeiouy .,]))|((\g<C>)(\g<C>)(\g<V>)(\g<V>))|(\b\g<C>)(\g<V>)(\g<V>)(\g<C>\b)/\3\6\5\9\8\11\14\13\16\18\17\19\20\21\23\22