GithubHelp home page GithubHelp logo

bfhs's Introduction

bfhs

Yet another Brainf*ck interpreter in Haskell.

Installation

git clone [email protected]:cezarguimaraes/bfhs.git
cd bfhs
cabal install

Interpreter details

  • Ignores any invalid characters as comments.
  • Max value is by default 255 and values wrap back to 0. Disable wrapping --no-value-wrap or change its maximum to x-1 with -mx (i.e, wrapping is done modulo x).
  • Maximum 30000 cells on the "tape" by default and wraps by default. Wrapping can be disabled and size of the tape can also be changed via options. Similar to cells. Check usage below.
  • State of a program after execution can be dumped with -d.

Usage

bfhs
Usage: bfhs [opts] file
  -b                          TODO: Program file contains its input before a ! character.
  -c[30000]                   Number of cells available to the program. Ignored when --no-cell-wrap is set.
             --no-cell-wrap   Disables cell wrapping. Virtually infinite memory.
  -m[256]                     Maximum value of a cell. Ignored when --no-value-wrap is set.
             --no-value-wrap  Disables value wrapping, i.e allows negative values on memory
  -h         --help           Shows this message
  -d         --dump-state     Dump interpreter state at the end of execution

Examples

  • Fibonacci

    $ bfhs examples/fib.bf
    1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89
  • Hello, World!

    $ bfhs examples/hello_world.bf
    Hello World!
  • cat

    $ echo "ping" | bfhs examples/cat.bf
    ping

bfhs's People

Contributors

cezarguimaraes avatar

Watchers

 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.