Menu

Tree [f2dc75] master /
 History

HTTPS access


File Date Author Commit
 Logo 2018-11-15 Neo_Chen Neo_Chen [55482f] Logo: wrong filename
 doc 2018-11-09 Neo_Chen Neo_Chen [983e09] DOC: Added document for my "bitcode"
 .gitignore 2018-11-09 Neo_Chen Neo_Chen [00c4c4] bitfunk and visualbitfunk no longer exist
 LICENSE 2018-09-30 Neo_Chen Neo_Chen [f31702] Initial Import
 Makefile 2018-11-17 Neo_Chen Neo_Chen [f2dc75] Makefile: Indent
 README.md 2018-11-15 Neo_Chen Neo_Chen [f81e6d] README: Logo too large, change to 256px
 bf2bitcode.c 2018-11-11 Neo_Chen Neo_Chen [1bde4a] Removed unused stuff
 bf2c.c 2018-11-15 Neo_Chen Neo_Chen [9825cf] libstdbfc: Program Stack is "stack", not "pstack"
 brainfunk.c 2018-11-17 Neo_Chen Neo_Chen [380fa8] No need to reallocation stack
 brainfunk2c.sh 2018-11-10 Neo_Chen Neo_Chen [a521c3] brainfunk2c: -O3
 libbrainfunk.c 2018-11-17 Neo_Chen Neo_Chen [61b5fe] libbrainfunk: Ignore invaild lines in bitcode
 libbrainfunk.h 2018-11-13 Neo_Chen Neo_Chen [962c26] VisualBrainfunk: Make new instructions interact...
 libstdbfc.h 2018-11-14 Neo_Chen Neo_Chen [852515] libstdbfc: Non-Buffered IO, no need to fflush()
 test.sh 2018-10-16 Neo_Chen Neo_Chen [c8f852] Test: Test both brainfunk and visualbrainfunk
 visualbrainfunk.c 2018-11-17 Neo_Chen Neo_Chen [380fa8] No need to reallocation stack

Read Me

Brainfunk

Neo_Chen's Brainfuck Toolkit

Passed all the tests

Brainfunk Logo

Brainfunk is a simple interpreter, it have simple byte code,
but without dynamic memory allocation. VisualBrainfunk is just
like Brainfunk, but with ncurses based UI and Visualization.
They all have some simple array bounds checking, so normally it won't coredumps.

Usage:

brainfunk   [-h] [-m] [-f file] [-b bitcode] [-c code] [-d]
visualbrainfunk [-h] [-m] [-f file] [-b bitcode] [-c code] [-d] [-t msec]
bf2bitcode  [-h] [-m] [-f infile] [-o outfile] [-c code] [-d]
bf2c        [-h] [-m] [-f infile] [-b bitcode] [-o outfile] [-c code] [-d]
  • -d is for debugging, super verbose
  • -f is the file to read, "-" for reading from stdin
  • -c is run code directly from the argument
  • -s sets code, stack, memory, and bitcode size
  • -t is delay between instructions, in millisecond
  • -m is for compatibility with Brainfuck

bf2c Usage:

Use bf2c to convert Brainfuck code to C, to compile it, add libstdbfc.h to compiler's search path (-I\<path>)

Brainfunk Instructions:

+   Increment
-   Decrement
>   Forward
<   Rewind
[   Loop start
]   Loop end
.   Output
,   Input
\   Pop stack
/   Push stack
(   If start
)   If end
'?? Set hexdecimal
$'??    Push hexdecimal
$+  Increment top of stack
$-  Decrement top of stack
$[  while(peek()) {
$]  }
$(  if(peek()) {
$)  }
$.  Output from stack
$,  Input to stack
~   Fork
!   Halt and catch fire!
_   Halt
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.