We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

Krypton

From Esolang
Jump to navigation Jump to search
This is still a work in progress. It may be changed in the future.

Krypton is an esoteric programing language invented by User:X-540. It is based on only using encryption, ciphers and basic string manipulation to do calculations

Syntax

This language uses polish notation, meaning that operators go before their arguments.
Parentheses are not allowed.
The return values of each line are printed to output.
; can be used to separate instructions, however is not required to be.
Whitespace is ignored outside of strings

Instructions

Instructions are in the format <instruction>[arguments...]

Instruction Description Example Example output Extra notes
=a b Sets a to b, returns b only to operators (not implicit printing) =foo "bar";foo bar Due to V being an operator, it may not be used in variable names. Variable names are not case sensitive.
+a b Concatenate strings +"foo""bar" foobar
-a b Remove all occurrences of b from a -"test""t" es
/a b c Replace every occurrence of b in a with c /"testerizer""t""m" mesmerizer
*a b Repeat a b times *"abcd""\1\2\3" abbcccd b is taken as a list of base 128 digits, with each character of a being repeated a number of times corresponding to the character at the same index in b. B is repeated if there are not enough characters
^a b Drop b characters from the beginning of a ^"hello there""\7" here b is interpreted as a base 128 number (the top bit is ignored due to not being used in ASCII)
_a b Drop b characters from the end of a _"hello there""\7" hell b is interpreted as a base 128 number (the top bit is ignored due to not being used in ASCII)
>a b c If a is not empty, return b, otherwise c +>"""hi""bye" >"not empty""hi""bye" hibye
<a b c If a contains a character other than \0, return a, otherwise b <"\0""aw man, I'm unreachable :(""haiii" haiii
va b Vigenere cipher of a and b v"fOo!""bar" gOf! Capital letters in the input stay capital, symbols remain unchanged.
Va b c Vigenere cipher of a and b with alphabet c V"1001""10""01" 0011 Unrecognized characters remain unchanged, if alphabet does not contain a specific case of a letter, but does contain it's other case, it's case is preserved, but is treated as the case that is in the alphabet.
#a b Perform the XOR cipher of a and b #" X(3,*!X. =O17 >""xor" XOR GATES ARE COOL The 256 bit is not ignored
` In functions returns the first argument, returns the input outside ` <input>
~ In functions returns the second argument, returns the input outside ~ <input>
!a [b [c]] Evaluate the string, how argument count is determined will be explained in the functions section !"(v``""test" mikm b and c are optional

Functions

In Krypton functions are just strings. The argument count of a function is determined by the first character, ( meaning one, [ meaning two, all other characters mean zero. Functions can be overwritten while running, even with a different argument count, however this is discouraged due to being incredibly cursed.

Examples

Hello world

"Hello world"

Truth machine

=T> -`"1" "\"0\"" ""\"1\";T";T

Computational class

I suspect that this language may be turing complete, however I do not have a proof of this yet.