DennisMitchell / jellylanguage

Jelly is a recreational programming language inspired by J.
MIT License
860 stars 47 forks source link

Allow ḅ to work on strings. #19

Open ruds opened 8 years ago

ruds commented 8 years ago

When I tried my hand at http://codegolf.stackexchange.com/questions/90711/what-base-is-this-number-in, I thought Ṁḅ26 should work, but it doesn't because e.g. "11"ḅ2 evaluates to nothing (1,1ḅ2 evaluates to 3).

Would it be reasonable to extend ḅ to convert string representations as well? Is there an atom that does something similar that I've missed?

GolfingSuccess commented 7 years ago

@ruds I don't think that's applicable at all for bases over 250, but, for [2, 250], it would have surely been handy. We already have a built-in for bijective base-250 integers, that is, “string’, but every char in string must be 1-indexed, unlike the 0-indexed code-page.