项目作者: AlexHowansky

项目描述 :
Boo Boo Kitty Fuck
高级语言: PHP
项目地址: git://github.com/AlexHowansky/bbkf.git
创建时间: 2016-11-11T17:41:24Z
项目社区:https://github.com/AlexHowansky/bbkf

开源协议:MIT License

下载


Boo Boo Kitty Fuck

Boo Boo Kitty Fuck is a feline variant of Brainfuck.

Source Code

A Boo Boo Kitty Fuck program is a single JPEG or PNG file which contains a gallery of cat images laid out in a rectangular grid. The image grid is processed starting in the upper left corner, proceeding left-to-right and top-to-bottom. The images represent Brainfuck operators as follows:

Brainfuck Operator Boo Boo Kitty Fuck Operator Meaning
> right Increment the data pointer.
< left Decrement the data pointer.
+ increment Increment the byte at the data pointer.
- decrement Decrement the byte at the data pointer.
. output Output the byte at the data pointer.
, input Accept one byte of input, storing its value in the byte at the data pointer.
[ open If the byte at the data pointer is zero, then instead of moving the instruction pointer forward to the next command, jump it forward to the command after the matching ] command.
] close If the byte at the data pointer is nonzero, then instead of moving the instruction pointer forward to the next command, jump it back to the command after the matching [ command.

Usage

The bin directory contains the following tools:

bbkf

Compile and run a Boo Boo Kitty Fuck program.

  1. % ./bin/bbkf example/hello.jpg
  2. Hello World!

If the program requires any input, it will be read from STDIN.

  1. echo "test" | ./bin/bbkf example/echo.jpg
  2. test

bbkf2bf

Compile a Boo Boo Kitty Fuck program to Brainfuck. Outputs to STDOUT.

  1. % ./bin/bbkf2bf example/hello.jpg
  2. ++++++++[<++++[<++<+++<+++<+>>>>-]<+<+<-<<+[>]>-]<<.<---.+++++++..+++.<<.>-.>.+++.------.--------.<<+.<++.
  3. % ./bin/bbkf2bf examples/echo.jpg
  4. ,[.,]

bf2bbkf

Compile a Brainfuck program to Boo Boo Kitty Fuck. Outputs to STDOUT.

  1. % ./bin/bf2bbkf example/hello.bf > /tmp/hello.jpg

Example

Here is the ubiquitous “Hello World!” program in BBKF:
Hello World!