Seems like a common request for functions to convert to and from char codes.
Time will show whether it shall be added to the program, but until then you can do it by yourself:
Initialization (59 tokens, 197 bytes):
(the blank comment is there solely to keep the editor from glitching out due to lack of escape sequence support)
After this is executed, you'll find yourself with having two tables - s2c, holding char->code pairs, and c2s, holding code->char pairs.
Since using these directly can be slightly less comfortable, here are a couple helper functions:
chr(code) : Returns the char (string) for the given code [13tk\36b]:
Example: chr(33) == "!"
ord(string, pos) : Returns the code for the character at the given position (optional argument) in a string [26tk\57b]:
Example: ord("Hello!", 6) == 33
chrs(...codes) : Forms a string from one or more codes [50tk\103b]
Example: chrs(104,105,33) == "hi!"
- If you are in a dire need, you can shorten the chars-string to only include the uppercase letters.
- Depending on situation, you may also want this to handle linebreak via
Then you can use the multiline string format [[ text ]]... which currently isn't considered as a string for token count though.