Giter Site home page Giter Site logo

regex-brainf-interpreter's Introduction

RegEx-BrainF-Interpreter

A Brainfuck interpreter in RegEx only (using Find/Replace). This demonstrates, that RegEx in combination with Find/Replace is Turing complete.

Usage

Use any Editor that can find/replace with RegEx Syntax. I tested this on Notepad++, but since I only used Perl RegEx Syntax, it should also work with other applications. Create a new file and add the Brainflakes source code on the first line. It must contain a sequence of only the 8 coding BF characters, all on the first and only line, like it's done HelloWorld.b

Use "find and replace" in RegEx mode with the "find" parameter from Find.txt and the "replace" parameter from Replace.txt. Click “replace all” once. This will set up the environment (now 4 lines of code). If the BF code demands input, you have to write it on line 2, AFTER the ‘|’ character.

Now click “replace all” many, many times. Or if you don't want to get cramps, use the keyboard shortcut for “replace all” (in the German Version of Notepad++ its alt+T).

The Interpreter will only stop:

  • When more user input is needed
  • When a HALT state is reached (end of code). It will remove everything except the output and stop replacing.

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.