Coder Social home page Coder Social logo

id101010 / bfckr Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 2.0 980 KB

A little brainfuck interpreter and debugger written in C.

License: Do What The F*ck You Want To Public License

Makefile 5.58% C 94.42%
brainfuck interpreter debugger memory-visualizer bandtape

bfckr's Introduction

bfckr Build Status

A simple to use brainfuck interpreter with built in debugger written in C.

How to run

  • Type "make"
  • Read this
  • Create your own brainfuck software
  • let bfckr run your own .bf code

Usage

Usage: ./bfckr [OPTION]
-h        Show this help.
-d        Enable debugger.
-f        Execute brainfuck code given as file.
-e        Execute brainfuck expression given as argument.

examples:

./bfckr -f examples/pi.bf

3.14070455282885

./bfckr -d -f examples/pi.bf

[ENTER]: single step [c]: continue
Source viewer:                                            
------------------------------------------------------------
                              >+++++++++++++++[<+>>>>>>>>+++
                              ^                             
                              ip=0                         
------------------------------------------------------------

Memory viewer:                                            
------------------------------------------------------------
000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 

                              ^                             
                              mp=1                         
000 000 000 000 000 000 001 002 003 004 005 006 007 008 009 
------------------------------------------------------------

Output viewer:                                              
------------------------------------------------------------

------------------------------------------------------------

./bfckr -e "----[---->+<]>++."

A

echo "42=" | ./bfckr -f examples/bintodec.bf

42=101010

Breakpoints

A # in the brainfuck source will be interpreted as breakpoint. You can use them if you want to stop the program flow at a specific point and start the debugger from there. If you are in debugger mode pressing c will get you back to executing the program.

./bfckr -e "----[#---->+<]>++."

[ENTER]: single step [c]: continue

Source viewer:                                            
------------------------------------------------------------
                         ----[#---->+<]>++.
                              ^                             
                              ip=5                         
------------------------------------------------------------

Memory viewer:                                            
------------------------------------------------------------
000 000 000 000 000 000 000 -04 000 000 000 000 000 000 000 
                              ^                             
                              mp=0                         
993 994 995 996 997 998 999 000 001 002 003 004 005 006 007 
------------------------------------------------------------

Output viewer:                                              
------------------------------------------------------------

------------------------------------------------------------

Licence

WTFPL

Copyright © 2016 Aaron [email protected] This work is free. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See the COPYING file for more details.

bfckr's People

Contributors

id101010 avatar mvrozanti avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.