CanCan
Jump to navigation
Jump to search
CanCan
CanCan is a programming language with only two commands: # and . It's designed to have the smallest interpreter possible.
This doesn't have a disadvantage because it cycles through commands with #
Command | Action |
---|---|
# | Cycle to next command |
. | Execute current command |
Command Number | Action |
---|---|
0 | Increment the accumulator |
1 | Decrement the accumulator |
2 | Output accumulator as ASCII |
3 | Allow for one byte of input, storing it in accumulator |
4 | Jump to the index stored in the accumulator |
5 | If accumulator is not 0, do next command. Otherwise skip over. |
There are two interpreters, ill state a link to the Github Gist of them:
- Python interpreter class: https://gist.github.com/codingelephants-gpt/0548f0835d75c2996feb882e895da88a
- Ruby Class (shortest, 239 bytes): https://gist.github.com/codingelephants-gpt/5b42ee159c1edba24826f14ca54265ec
Feel free to add your own interpreters here.