Printing a Chunk Of Words

Matt Wheeler m at funkyhat.org
Wed Sep 27 15:04:37 EDT 2017


On Wed, 27 Sep 2017 at 14:48 Peter Otten <__peter__ at web.de> wrote:

> > Reproducing the original string exactly the best I've managed is 260:
>
> That's a bit long, don't you think, as it can be beaten even by plain old
> zipping:
>

ha! tbh yes It's longer than I was expecting to manage.

$ cat booltable2.py
> from codecs
>
> import*;print(decode(decode(b'eJzjUgABp/z8nNTEPAX/gtSixJL8omIuXRwArFyBK6SoNFUhMS9FAczILAbTCFG3xJxisDCYwQXh\nIitHF0fTADEpvwiL8UBBuGKwKISHrhYuim6yX34JmitAIqhGcgEAEnJWfA==\n',"base64"),"zip").decode())$

$ wc -c booltable2.py
> 210 booltable2.py
>

Well, ok, but mine is at least parseable by a sufficiently masochistic
human, though I suppose that was never given as a requirement :D

(You could also shave off 4 more bytes by importing `decode` as `d` rather
than your nice `import*` trick, because you call it 3 times)


> [snip]
>
> :)
>

:D



On Wed, 27 Sep 2017 at 17:50 Thomas Jollans <tjol at tjol.eu> wrote:

> Touché.
>
> You're still missing some whitespace, though ;-) (like, I think,
> everybody else in this weird international obfuscated Python competition)
>

I guess you still didn't run it ;D (see the 2nd `for` statement). I diffed
my output against the original, which is why I'm confident in the
correctness of my solution ;)

Actually I managed to shave off another byte by changing `l.insert(i,'')`
to `l[i:i]=['']`, so now I'm on 259. I should probably stop now...
-- 

--
Matt Wheeler
http://funkyh.at



More information about the Python-list mailing list