Share your repls and programming experiences

← Back to all posts
The most complicated "hello world" program in a single line
MarcusWeinberger (779)

How it was made

First, I went through all the characters in "hello world" and used ord to find their numerical values. Using the argcount of a bunch of lambdas, I got a list of numbers 1 through 7. Using that list, I simply did some maths to get the numbers and printed them as ascii using chr.

I wrapped this in a couple lambdas using globals().update to set variables inline ( recently updated to python 3.8 so I could have used the := operator however it appears not to work in list comprehension) and bam.

(ignore the syntax errors, it still runs)

AaravKyparlis (0)

takes a while to load

MarcusWeinberger (779)

@AaravKyparlis that's strange, for me, it's almost instant

AaravKyparlis (0)

@MarcusWeinberger I probably have a laggy computer


Generally, it's supposed to be "Hello world!", so it's missing a capital H, and an exclamation mark, "!"

Dart (1191)

“Code was built to be efficient and sleek. so let’s go in the exact opposite direction!”
(This really cool omg)

LiamDonohue (291)

im a cool kid

no i am

AlphaWarhead (5)

No exclamation mark, 0/10

LiamDonohue (291)

im so gonna do this

IsackSan (4)

nice but overcomplicated.. Like my life!

AdCharity (1314)

at least this actually makes sense


@AdCharity You still remember don't you?

qualladoom (359)

Oh boy, that's like reverse code golf. I love it

ChezCoder (1598)

i really dont know what to say...

sugarfi (627)

1810 bytes just to print "hello":

x=list(str(sum([*map(lambda x:sum([*map(int,(bin(ord(x))[2:]))]),'hello world!')])*(1<<1|1)));y=x[9//2//(9//2)];x[654**0<<1]=x[3>>1];x[(10^1)&1]=eval(chr(ord('Y')+(2<<4)),locals());x=__import__('htam'[::~0]).sqrt(int('abc'[:8*(2>>3)].join(x)));x=int(x//4*(2<<2>>1))+[~~(1&1&1&1&1&1&1)][0];x*=len(hex(3735928559)[[*[2<<1>>1]][0]:]);print(chr(x),file=getattr(__import__(chr(ord('S')+(2<<4))+'y'+chr(ord('t')-1)),'stdout'),end='');x=str(6+(2&3^2&3))+[*map(str,[*[int(str(6))+(6//2)]])][0];y=int((int(x)|[*[4*((34^34)|1<<3)]][0]));i=sum([*[*[*[y if ~((int(x)*c)>y) else 0 for c in range(5^5,int(str(10)*2,base=2<<1>>1),5%2)]]]]);i=int(str(i)[:~0]);z=getattr(__import__(chr(int('12'[:5&abs(~0)]*(1<<1|1)))+chr(i+(1<<2|1<<1|1)+int(hex(7)[2:],base=16))),'sys');getattr(z,'stdo'+chr(10**(1<<1)+(8*9-(7*9)+8))+chr(10**(1<<1)+(8*9-(7*9)+7))).write.__call__(chr(i));d={'ba'+[*[chr(ord('S')+(2<<4))]][0]+chr(int(bin(5)[2:])):2};x=ord(getattr(__builtins__,'ch'+chr(ord('R')+[*[2<<4]][0])).__call__(ord('0')+(2<<(int(str(ord('e')),**d))-(2<<1))));x=eval(compile('x','','eval'),globals())*(eval(type(5).__name__)(chr(eval(compile('x','','eval'),globals()))));x=int(x-(round.__call__(x//((7>>1)&2),-1)));a={'end':'end'[:2-(~~2)]};print(chr(x)*2,**{**a,**{'file':getattr(__import__(chr(ord('S')+((2<<5)//2))+chr(ord('n')+int(str(10)*2,base=2)+5%2)+chr(ord('S')+((2<<5)//2))),'_'*2+'stdo'+'u'+chr(ord('n')-ord('n')+ord('t'))+'_'*2)}});x=str(ord.__call__(chr(ord('0')+(2<<(int(str(ord('e')),base=2)%2+eval('~'*5+chr(48))))))*(1<<(5&(1<<0))));x=eval('__builtins__.__dict__')['chr'].__call__(int(x)+int(x[:[*[(5&1&1&1)+1]][0]])+int(x[:[*[1]][0]]));d={};print(x,file=getattr(eval('s',d) if not exec('import '+ord('y').__getattribute__('__repr__').__call__().replace('1','s').replace('2','y')+';s=sys',d) else None,'stdout'),end='');

Try it online!

Coder100 (17478)

such verbose

while True and "verbose is verbose" and "this is as verbose as I can get":
  votes = int(str(votes + 0 + 1))
  magic = int(str(magic + 1 + 0))

oh no

SixBeeps (5137)

This is too good. And it's in exactly 555 chars :D


And I noticed something else: 555 chars in the code, and 5 upvotes for first comment, 5 for the second one, and 5 for the third! This post is all about fives. @SixBeeps


And the first time I looked at your reply, it was posted 5 seconds ago! @SixBeeps