This was inspired by Brain Fuck.
Like BF instructions are single characters and are very limited.
However in theory this is turing complete.
Memory composes of Rods, which hold Beads.
By default (const unsigned int LeftStart = 10) each Rod starts with 10 Beads on the left,
These can only be shifted from one side of the Rod to the other.
NEVER creating going above the initial 10 Beads total on the Rod.
This means the code cannot overflow or underflow, so you may end up with values capping at LeftStart or 0!
| Char | Effect |
|---|---|
| > | Move a bead from Left to Right |
| < | Move a bead from Right to Left |
| U | Go Up a Rod |
| D | Go Down a Rod |
| L | Do if Left NOT 0 |
| R | Do if Right NOT 0 |
| ] | End of if |
| T | Display Memory |
| Console R/W coming soon |
Rod 0 = R0
Rod 0 Left Beads = R0L
Rod 0 Right Beads = ROR
So for Rod 1
R1, R1L, R1R respectively
Assuming the 2 rows are sequential (R0, R1)
DR<U>D]
This loops until the Right beads of the R1 is 0
Each time R1R-1 and then R0R+1
Assuming the 2 rows are sequential (R0, R1)
R<UR<DD>D>UUU]DDR<UU>DD]U]
R1R-1
Destructively duplicates R0 into R2, R3
Copies R2 back to R0
This loops till R1R==0
Hence R3 will become the multiplied sum
>>>>>>>DD>UURDDRD]UR<D>D>UU]DDR<UU>DD]UUUR<DD>D>UUU]DDDR<UUU>DDD]URU]U]T