https://github.com/refi64/b.k
A BF interpreter written in K
https://github.com/refi64/b.k
Last synced: 5 months ago
JSON representation
A BF interpreter written in K
- Host: GitHub
- URL: https://github.com/refi64/b.k
- Owner: refi64
- Created: 2015-04-11T00:32:03.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2016-04-25T15:59:41.000Z (about 10 years ago)
- Last Synced: 2025-03-25T05:06:45.252Z (about 1 year ago)
- Size: 9.77 KB
- Stars: 2
- Watchers: 5
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
Awesome Lists containing this project
README
b.k
===
A Brainf*** interpreter written in K. You know, the language that goes like this::
+ increment value at tape pointer
- decrement value at tape pointer
< decrement tape pointer
> increment tape pointer
[ jump to the matching right bracket is the value at the tape pointer is 0
] jump to the matching left bracket is the value at the tape pointer is not 0
. print the value at the tape pointer
, read a character from the screen
This interpreter is by no means fast...but it works. Pretty well, too, except that I didn't implement the ``,`` character because, as far as I know, reading a single character isn't possible with K2 unless you resort to C extensions. This is written for `Kona `_ and K2, NOT kdb+ 3. It will NOT run under kdb+ 3 (if you figure out how without using q, let me know!).
The whole thing is (without comments and blank lines) 378 characters (358 if you remove unnecessary newlines).