Skip to content
Sign UpLog In
This post is read-only. Explore Repls and connect with other creators on Community.View Community
The info in this post might be out of date, check out our docs instead. View docs
9

1 line code challenge

gantr833
gantr833

Who can create the coolest thing in just one line of code.

4 years ago

Voters

Comments

TopNew
6
chilaxan
chilaxan
print(eval(f"(LB=Lc='X',b=L:int(input(a)),d=[*range(9)],e=Lp=print:[a,p('_'*7),[p('',*a[x:x+3],'',sep='|')for x in[0,3,6]]][0]:(Lb:[b]*9if 1in[all([b==a[int(x)]for x in str(list(map(ord,'ÒřʦɶơĂ͈ö'))[y])])for y in range(8)]else a)((Lb,c,d:[b.pop(c),b.insert(c,d),b][2])([e(d),e(a)],a,d.index(b(c)),c)if['X']*9!=a!=['O']*9else a,c):(L:'X'*(a==['X']*9)+'O'*(a==['O']*9)or'C')({'B('*9}[' ']*9){',a))'*4}))('O')".replace('L','lambda a,')))

One line tic tac toe

4 years ago
1
IlexisTheMadcat
IlexisTheMadcat

@chilaxan
Really cool!

4 years ago
3
gantr833
gantr833

@chilaxan
: That's one long line! Nice job!

4 years ago
2
ChristianThone
ChristianThone

@gantr833

for i in range(1000): print("One Line Code Challenge. This line prints One-Thousand Times.")
4 years ago
3
gantr833
gantr833

@ChristianThone
: Very nice, I hope that doesn't crash my computer ;)

4 years ago
2
ash15khng
ash15khng

Swift:

fatalError("lol")
4 years ago
2
John_WardWard
John_WardWard

print ("Hello World")

:)

4 years ago
2
SPQR
SPQR

is this a "the whole source file has to be one line" or a "the (cool/important/unique) stuff is on one line"?

4 years ago
3
gantr833
gantr833

@SPQR
: the whole thing you are creating on one line.

4 years ago
2
Nanashi
Nanashi

Well, this is FizzBuzz in 59 characters of python 3:

for i in range(100):print(i%3//2*"Fizz"+i%5//4*"Buzz"or-~i)
4 years ago
Load more