https://github.com/gregorybchris/cheso
Esoteric programming language interpreter
https://github.com/gregorybchris/cheso
Last synced: about 2 months ago
JSON representation
Esoteric programming language interpreter
- Host: GitHub
- URL: https://github.com/gregorybchris/cheso
- Owner: gregorybchris
- Created: 2016-10-02T07:28:24.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2021-03-10T04:58:43.000Z (almost 5 years ago)
- Last Synced: 2025-01-12T15:12:38.357Z (about 1 year ago)
- Language: C
- Homepage:
- Size: 12.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Cheso
## About
Cheso is an esoteric programming language (Pronounced CHAY-so) with an interpreter written in C. It's about as simple as a language can get while still being Turing complete. Cheso is a less legible and less vulgar version of the language [BrainF**k](https://en.wikipedia.org/wiki/Brainfuck).
## Compiling the Source
To compile the interpreter use the provided Makefile by running the `make` command in the directory with the source files. Then run a .cheso program file with the command: `./cheso program.cheso`
## Writing a Program
A Cheso program is a string of instructions. Each instruction is one character and blank space is ignored. The number of registers available is limited only by physical memory and each register can hold a large non-negative integer. The ASCII character corresponding to the integer in a register can be printed and the inverse operation is possible for reading a character. Loops will continue to run as long as the current register is non-zero at the end of each iteration.
- Start/end a loop - `s`/`e`
- Increment/decrement the current register - `u`/`d`
- Shift left or right one register - `l`/`r`
- Print the ASCII character in the current register - `p`
- Place a character taken as input in the current register - `i`
## Example
The following code will output `I <3 chips and Cheso`
```txt
uuuuuuuuuuuuuuu
s
ru
ruuu
ruuuu
ruuuuu
ruuuuuu
ruu
ruuuuuuu
ruuuuuuuu
lllllllld
e
rrrrddp
rruup
lllp
luuuuuup
rrrrp
rddddddp
uuuuup
up
uuuuuuup
uuup
lp
luuuuuuup
rrdddddp
lluuup
rp
llddddddp
ruuuup
dddp
rruuuuup
ddddp
```