Timeline for answer to Paint Starry Night, objectively, in 1kB of code by orlp
Current License: CC BY-SA 3.0
Post Revisions
13 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jun 17, 2020 at 9:04 | history | edited | CommunityBot |
Commonmark migration
|
|
| Jan 28, 2016 at 8:18 | comment | added | nneonneo |
Yes, I can remove 1 from latin1 and save a whitespace from import *, at least. But golfing that wasn't a priority (since it is less than 1024 bytes).
|
|
| Jan 28, 2016 at 8:17 | comment | added | feersum | @nneonneo Yes, I have used this technique before. Looks like you could save 2 bytes from it. | |
| Jan 28, 2016 at 8:08 | comment | added | nneonneo | @feersum, admalledd: See my answer for a technique that allows you to embed arbitrary binary data in a triple-quoted string which is directly usable by the program. The only characters that need to be escaped are the backslash and null bytes (and quote characters, if you might have 3 in a row). | |
| Jan 27, 2016 at 13:24 | comment | added | Steve Jessop | Python allows Windows CP-1252 as an encoding, which is pretty dense, so it should be possible to do a lot better base 85. Say, base 240-ish or more. But like admalledd says, there's the issue of whether the code to decode that is sufficiently golfable to fit in the space freed up by the more compact encoding. | |
| Jan 25, 2016 at 22:52 | comment | added | admalledd |
@orlp possible idea (no idea if it is reasonably golf-able): store it at the end of file inside a tripe-quoted variable and use slicing on the read? eg: r=open(__file__).read();f=r[r.index('a="""',75)+5:-3];RESTOFCODE; a="""(BINDATA)""". I am away for a while though from any decent python interpreter to test with though. Some work would be needed to slightly convert the binary to something one of pythons accepted source code encodings would allow... Probable still that this would take more bytes than you would gain...
|
|
| Jan 24, 2016 at 8:16 | comment | added | N. Virgo | @calvin'shobbies alright, that makes sense, I've unaccepted for now. (Sorry orlp) | |
| Jan 24, 2016 at 7:01 | comment | added | Calvin's Hobbies | @Nathaniel You only asked this today so I suggest you don't mark this answer (or any answer) the accepted answer yet. When people see an answer has been accepted they may assume the contest is over and won't participate. I think it's best to wait at least a week or two before accepting any answer. | |
| Jan 24, 2016 at 2:06 | comment | added | N. Virgo | Score confirmed and validated - this is the winner for now. | |
| Jan 24, 2016 at 2:05 | vote | accept | N. Virgo | ||
| Jan 24, 2016 at 8:14 | |||||
| Jan 23, 2016 at 23:09 | comment | added | orlp | @feersum I don't know how to store binary data inside Python files in a better way than base encoding. | |
| Jan 23, 2016 at 23:08 | comment | added | feersum | Surely it would be better to store the data using all 256 bytes instead of base 64, 85 or whatever. | |
| Jan 23, 2016 at 23:01 | history | answered | orlp | CC BY-SA 3.0 |