pyth
pyth copied to clipboard
Switch `."` to bijective base.
What do you mean by bijective base?
https://en.wikipedia.org/wiki/Bijective_numeration
Would this be a form of compression?
Sorry, I should explain more. ."
currently has a bug, where it can't encode anything where the leading character is the lowest character. Bijective numeration would fix this.
oh, I see what you mean, the things goes to a 0, which disappears when you store it as a number.
Looks like I started this issue. I also provided a compressor and a decompressor.
What happens if the compressed string includes "
or a carriage return (#186)? We probably want to exclude those bytes and use base-254.
By the way, last month I came up with a neat alternative to bijective numeration that’s way more golfable.
Also: https://en.wikipedia.org/wiki/Negative_base
@DonaldTsang I don’t see how negative bases help here; they need a nonzero leading digit the same way positive bases do.