https://github.com/hex2f/thonkheck
https://github.com/hex2f/thonkheck
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/hex2f/thonkheck
- Owner: hex2f
- Created: 2019-04-21T18:58:56.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-22T18:47:54.000Z (about 7 years ago)
- Last Synced: 2025-08-31T04:02:22.925Z (9 months ago)
- Language: JavaScript
- Size: 6.84 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ThonkHeck
## What is it?
It's an esolang inspired by BrainFuck.
It is tape based and looks sort of like this:
```
Temp: 0
[0,0,0,0,0,0,0,0,0...]
^
```
The main idea is:
You can move the cursor on the tape and add, subtract, divide or multiply cells.
There's some other stuff in there as well, read more in the Tokens section.
## How do i use the included interpreter?
```js
const Runtime = require('./runtime.js')
new Runtime(
// The code you want to parse, this code prints ABC
'++++++++++^>++++++*+++++|+|+.',
// The function to be called on flush ( | )
(text) => console.log(text)
).run() // Run it!
```
## What tokens are there?
| Token | What it does |
|-------|-----------------------------------------------------------------------------------------|
| + | Add one to the current cell |
| - | Subtract one from the current cell |
| > | Move to the next cell |
| < | Move to the previous cell |
| ^ | Clone the current cell to the temp cell |
| * | Multiply the current cell with the temp cell, outputs to current cell |
| / | Divide the current cell with the temp cell, outputs to current cell |
| [ | Push a new loopback position |
| ] | If the current cell is 0, move on. Else: go back to the last loopback |
| . | Get the current cell, convert to string (UTF-16), push to the print buffer and flush it |
| \| | Get the current cell, convert to string (UTF-16), push to the print buffer |
| @ | Starts and ends comments, everything between is ignored on runtime |