CXESO
CXESO is an esoteric programming language implemented by User:BoundedBeans in TI-BASIC on a TI-84 Plus CE calculator. It's mainly inspired by brainfuck (for most commands) and bitch (for the loop commands).
Data storage
CXESO has a tape of up to 999 complex numbers (implemented as a TI-84 list variable). The complex numbers really behave more like pairs of numbers though, and don't really function like mathematical complex numbers due to the minimalism of the instruction set.
Commands
Command | Semantics |
---|---|
[ |
Move the data pointer left. |
] |
Move the data pointer right. |
+ |
Increment the pointed complex number's real part by 1. |
- |
Decrement the pointed complex number's real part by 1. |
} |
Increment the pointed complex number's imaginary part by 1. |
{ |
Decrement the pointed complex number's imaginary part by 1. |
= |
If the pointed complex number's real part is 0, skip the next command. |
≠ |
If the pointed complex number's imaginary part is 0, skip the next command. |
> |
Set jump point A to this command. |
≥ |
Set jump point B to this command. |
< |
Goto jump point A. This is useful along with the = and ≠ commands to conditionally do the jump.
|
≤ |
Goto jump point B. This is useful along with the = and ≠ commands to conditionally do the jump.
|
? |
Input a complex number and store it in the list at the data pointer. |
Θ |
Output the currently pointed complex number. |
Goto |
Skips to the next occurrence of the Stop command. Note that a space after "Goto" is required but doesn't show up on wiki formatting ("Goto " and "Stop" are treated as single characters in the TI-84 calculator). This is useful along with the = and ≠ commands to conditionally do the jump.
|
Examples
Add two real integers >= 1
?]?>-[+]=<[Θ
Multiply two real integers >= 1
?]?-[>-]]+]+[[[=<]]]>-[[[+]]]=<[[>-]≥-]+[[[+]]=≤]≥-[+]=≤[[=<[Θ
Takes approximately 10 seconds to multiply 3 * 2 on the TI-84, larger numbers will take even longer.
Original TI-84 Basic code
Unfortunately you need to type this in manually into the calculator like the old days. Or you could translate it to some other language. Note that every alphanumeric in this code that has any lowercase letters is a single symbol that you have to find somewhere (Stop is in prgm->CTL for example)
:Ans→Str5 :{0}→L₁ :1→V :1→W :1→D :For(I,1,length(Str5),1 :sub(Str5,I,1→Str6 :If Str6="[ :D-1→D :If Str6="] :Then :D+1→D :If D>dim(L₁ :1+dim(L₁→dim(L₁) :End :If Str6="+ :1+L₁(D→L₁(D :If Str6="- :‾1+L₁(D→L₁(D :If Str6="} :i+L₁(D→L₁(D :If Str6="{ :‾i+L₁(D→L₁(D :If Str6="=" and real(L₁(D))=0 or Str6="≠" and imag(L₁(D))=0 :I+1→I :If Str6="> :I→V :If Str6="≥ :I→W :If Str6="< :V→I :If Str6="≤ :W→I :If Str6="? :Then :Input Θ :Θ→L₁(D :End :If Str6="Θ :Disp L₁(D :If Str6="Goto :inString(Str5,"Stop",I→I :End