Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Challenges

Post History

60%
+1 −0
Challenges 55 fruit salad: choose your own Kolmogorov complexity

Python 3, 325 322 bytes -3 bytes thanks to steffan153‭! from base64 import* n=int.from_bytes(b85decode('8C^#Z9Uor=^}*nk`yLA}A<z=aTm_V+z!I{Y1+v7z89f>WmC>M4TN(sPp`fvySOeqafPpzk0!*=hK2{h9D...

posted 1y ago by Moshi‭  ·  edited 1y ago by Moshi‭

Answer
#2: Post edited by user avatar Moshi‭ · 2022-09-30T03:16:32Z (over 1 year ago)
  • # [Python 3], 325 bytes
  • I win by one byte
  • <!-- language-all: lang-python -->
  • from base64 import*
  • n=int.from_bytes(b85decode('8C^#Z9Uor=^}*nk`yLA}A<z=aTm_V+z!I{Y1+v7z89f>WmC>M4TN(sPp`fvySOeqafPpzk0!*=hK2{h9DQZ9#JvR$o@^Bj)76Q|8U{@9v3>hyB9Zvx)9|;*A2pJv<7(E2D+z(Tn1bZ6`SxO69NeLD>3OHB+p^^q&7X=p=1f0PFWPt=oaR$}kMV<qq(4(9JlEBeS0=2NDO9hjVN+}6JU@~C'),'big')
  • while n:print(',aiueobcklmnprst'[n%16],end='');n//=16
  • [Try it online!][TIO-l8l6lfhj]
  • Originally I was going to use zlib, but trying to use the encoded result as a literal gave a lot of issues, so I decided to use base85 instead. There are probably some optimizations I missed since I don't really do Python often enough.
  • [Python 3]: https://docs.python.org/3/
  • [TIO-l8l6lfhj]: https://tio.run/##FdDbUoJAAADQd79CR4ubk4IGbrqMojZlXvBeNKGgS6CyLEgkqP061fN5OyQObQ9X0tQKPDdrGkckVrOOS7wgZDMYOji8@5eVGYfoSJu1@y3aeFtEU7W2ntfA3AugfmXxfh33W9dWI4HGzF0tuCT3fH7juUhKasCSl25bHlRnQ/qokrUVxdMR8g1LJcm@nGOh/SKcbdAZayDfiyYFr6krO0YSx5fa/NwEUUW2YwVo0YkBlzrbEkgvakh0V@hwCT3DvKmJ6@lpJIIh6nfkyuhJ4Yiu@7fSKySQt8rq41INoWdMCtf9YNHwfbpKg96hq6BpGQrDzgjYu8WQu4q9efOnTTFFynQ@KSbzbTsHlMUPJPg7oKmi4Xwhz9zsDy4mwTGk3vENL34UEd5CimLquFSCvJimvw "Python 3 – Try It Online"
  • # [Python 3], ~~325~~ 322 bytes
  • *-3 bytes thanks to steffan153‭!*
  • ```python
  • from base64 import*
  • n=int.from_bytes(b85decode('8C^#Z9Uor=^}*nk`yLA}A<z=aTm_V+z!I{Y1+v7z89f>WmC>M4TN(sPp`fvySOeqafPpzk0!*=hK2{h9DQZ9#JvR$o@^Bj)76Q|8U{@9v3>hyB9Zvx)9|;*A2pJv<7(E2D+z(Tn1bZ6`SxO69NeLD>3OHB+p^^q&7X=p=1f0PFWPt=oaR$}kMV<qq(4(9JlEBeS0=2NDO9hjVN+}6JU@~C'),'big')
  • while n:print(end=',aiueobcklmnprst'[n%16]);n//=16
  • ```
  • [Try it online!][TIO-l8l6lfhj]
  • Originally, I was going to use zlib, but trying to use the encoded result as a literal gave a lot of issues, so I decided to use base85 instead. There are probably some optimizations I missed since I don't really do Python often enough.
  • [Python 3]: https://docs.python.org/3/
  • [TIO-l8l6lfhj]: https://tio.run/##FdDbUoJAAADQd79CR4ubk6IGbrqMojZlingvmlDQJVBZViQSlH6d6vm8HRIFtoeraWr5nps1jRMSalnHJZ4fsBkMHRzc/cvKjAJ0os36/RZtvC2iqXpHz2tg7vlQT1i8X0eDdtJuxtCYuasFF@eeL288F4pxHVjS0u1Iw9pMoU8qWVthNB2ho2GpJN6Xcyy0XyoXG3THGsj3w0nBa@nyjhGF8bU@v7RAWJXsSAZaeGbAtcG2K6QfNkW6V@lyMT3DvKkJ6@l5JAAFDbpSdfQkc0TXj7fiKySQt8rq41INoGdMCsl@uGgej3SNBv1DT0bTMqwo3RGwdwuFS4T@vPXToZgiZTqfFJP5tp0DyuIH4v8d0AhvIVU0nC/kmZv9wcXEPwXUO77hhQ@mgUslyAtp@gs "Python 3 – Try It Online"
#1: Initial revision by user avatar Moshi‭ · 2022-09-28T05:23:55Z (over 1 year ago)
# [Python 3], 325 bytes

I win by one byte

<!-- language-all: lang-python -->

    from base64 import*
    n=int.from_bytes(b85decode('8C^#Z9Uor=^}*nk`yLA}A<z=aTm_V+z!I{Y1+v7z89f>WmC>M4TN(sPp`fvySOeqafPpzk0!*=hK2{h9DQZ9#JvR$o@^Bj)76Q|8U{@9v3>hyB9Zvx)9|;*A2pJv<7(E2D+z(Tn1bZ6`SxO69NeLD>3OHB+p^^q&7X=p=1f0PFWPt=oaR$}kMV<qq(4(9JlEBeS0=2NDO9hjVN+}6JU@~C'),'big')
    while n:print(',aiueobcklmnprst'[n%16],end='');n//=16

[Try it online!][TIO-l8l6lfhj]

Originally I was going to use zlib, but trying to use the encoded result as a literal gave a lot of issues, so I decided to use base85 instead. There are probably some optimizations I missed since I don't really do Python often enough.

[Python 3]: https://docs.python.org/3/
[TIO-l8l6lfhj]: https://tio.run/##FdDbUoJAAADQd79CR4ubk4IGbrqMojZlXvBeNKGgS6CyLEgkqP061fN5OyQObQ9X0tQKPDdrGkckVrOOS7wgZDMYOji8@5eVGYfoSJu1@y3aeFtEU7W2ntfA3AugfmXxfh33W9dWI4HGzF0tuCT3fH7juUhKasCSl25bHlRnQ/qokrUVxdMR8g1LJcm@nGOh/SKcbdAZayDfiyYFr6krO0YSx5fa/NwEUUW2YwVo0YkBlzrbEkgvakh0V@hwCT3DvKmJ6@lpJIIh6nfkyuhJ4Yiu@7fSKySQt8rq41INoWdMCtf9YNHwfbpKg96hq6BpGQrDzgjYu8WQu4q9efOnTTFFynQ@KSbzbTsHlMUPJPg7oKmi4Xwhz9zsDy4mwTGk3vENL34UEd5CimLquFSCvJimvw "Python 3 – Try It Online"