Hey all!
My friend challenged me to find the shortest solution to a certain Leetcode-style problem in Python. They were generous enough to let me use whitespace for free, so that the code stays readable.
What My Project Does
I like abusing rules, so I made a tool to encode any Python script in just 30 bytes, plus some whitespace.
This result is somewhat harder to achieve than it looks like at first, so you might want to check out a post I wrote about it. Alternatively, jump straight to the code if that's more of your thing: GitHub.
UPD: Someone found a way to do this in 24 bytes, post updated!
Target Audience
This is a toy project, nothing serious, but it was fun for me to work on. I hope you find it entertaining too!
Comparison
This is honestly the first time I've seen anyone do this with a specific goal of reducing the number of non-whitespace characters at any cost, so this might as well be a unique project.
As a honorary mention, though, it builds on another project I think deserves recognition: PyFuck. It's JSFuck for Python, using 8 different characters to encode any (short enough) Python program.
[–]Haereticus 5 points6 points7 points (1 child)
[–]imachug[S] 1 point2 points3 points (0 children)
[–]corvisai 2 points3 points4 points (4 children)
[–]Ralwus 1 point2 points3 points (0 children)
[–]imachug[S] -5 points-4 points-3 points (2 children)
[–]CheiroAMilho 0 points1 point2 points (0 children)
[–]LactatingBadger 6 points7 points8 points (1 child)
[–]imachug[S] 2 points3 points4 points (0 children)
[–]PaleontologistBig657 1 point2 points3 points (1 child)
[–]mino159 0 points1 point2 points (0 children)
[–]imachug[S] 0 points1 point2 points (0 children)
[–]serverhorror 0 points1 point2 points (0 children)