~X
Designed by | User:Insulation |
---|---|
Appeared in | 2025 |
Computational class | Possibly Turing-Complete |
Major implementations | Penguinmod Interpreter |
Influenced by | OISC |
File extension(s) | .tx |
~X is an esoteric programming language that only has 1 command.
It can store 8-bit integers (0-255) in a theoretically infinite memory tape. Implementations can only store a finite number of memory, so infinite memory is not required.
The only command is:
Instruction | Description |
---|---|
~ [X] | Run command with parameter [X] based on current mode. |
Anything that's not a valid command can be considered as comments.
Modes
~X has 4 modes, which change depending on the current line. Every program starts at mode 1, and with each instruction, the mode counter goes up. Modes will reset to 1 if over 4.
Mode # | Description |
---|---|
1 | Add current memory cell by [X]. |
2 | Change memory pointer by [X]. |
3 | If [X] is 1, ask for input, then get the first character and store its ASCII number into the current memory cell. If [X] is 0, output the current memory cell as ASCII. |
4 | If the current memory cell is zero, jump to line [X]. |
Overflow
Despite not having a dedicated subtraction operation, you can still subtract by doing overflow. Since ~X can only store 8-bit integers, going over 255 warps that number to 0. This can be used to do arithmetic.
Examples
Print "Hi"
~ 72 < Store 72 "H" ~ 0 < Don't move pointer ~ 0 < Print ASCII ~ 5 < Jump to line 5 ~ 33 < Add 33 to 72 (72+33=105 "i") ~ 0 < Don't move pointer ~ 0 < Print ASCII (Output: Hi)
Interpreters
An interpreter in Penguinmod has been created, although the website won't let me upload it due to me being a new user. Feel free to write your own.