Coder Social home page Coder Social logo

brainrust's Introduction

Introduction

This is BrainFuck interpreter written in rust. The 1st version (or possibly more) is just vanilla BrainFuck, the other are upgraded versions with more commands etc. It is just some funny project, not for real usage.

Usage

  • To use this interpreter download source files and compile it with rust or download precompiled program from Releases
  • Then run it from console/terminal with path to BrainFuck (.bf) file in argument eg.
.\BrainRust.exe .\code.bf

Additional options

  • -v - makes interpreter only use vanilla BrainFuck commands (+-><.,[]), rest gonna be skipped. Run program like this:
.\BrainRust.exe .\code.bf -v

Current commands

**COMMANDS THAT ARE IN VANILLA BRAINFUCK**
+ : Increments the value at the current cell by one
- : Decrements the value at the current cell by one
> : Moves the data pointer to the next cell (cell on the right)
< : Moves the data pointer to the previous cell (cell on the left)
. : Prints the ASCII value at the current cell (i.e. 65 = 'A')
, : Reads a single input character into the current cell
[ : If the value at the current cell is zero, skips to the corresponding ]
    Otherwise, move to the next instruction
] : If the value at the current cell is zero, move to the next instruction.
    Otherwise, move backwards in the instructions to the corresponding [

[ and ] form a while loop. Obviously, they must be balanced.

**BELOW ARE COMMANDS THAT ARE NOT IN VANILLA BRAINFUCK, SO WITH -v OPTION THAT ARE GONNA BE SKIPPED**
\ : Sets current cell value to 10 (LFeed)
b'x' : Sets x character ASCII table value to current cell
s"abc" : Sets abc string (any numbers of characters) values to the current cell and the next ones as required, if you want to add " to the string use \"

0xAA : Sets hex value after 0x to the current cell
0d123 : Sets decimal value after 0d to the current cell
0b11001010 : Sets binary value after 0b to the current cell

f[file_path]{operations} - opens file `file_path` or creates it and executes commands in file and the file contents is new tape (of length 30000, so content above 30000 characters in file can't be accessible)

brainrust's People

Contributors

q1000q avatar

Stargazers

 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.