Giter VIP home page Giter VIP logo

bfinterpreter's People

Contributors

mrvacbob avatar

Watchers

 avatar

bfinterpreter's Issues

Congratulations :-)

You have beaten my brainfuck torture test and yet still have a nasty little bug.
Luckily I decided to run a full performance test and a few of the tests failed.
Here's the first boiled down test case:

$ astrange-bfi-switch <( echo '>+[>+>]<[<<]><++++++++++. '  )
 0 | 0 | PtrRight1
 1 | 0 | Inc1
 2 | 0 | Jz     (7, 2, =PtrLeft1)
 3 | 1 | PtrRight1
 4 | 1 | Inc1
 5 | 1 | PtrRight1
 6 | 1 | Jnz    (3, 1, =PtrRight1)
 7 | 2 | PtrLeft1
 8 | 2 | Jz     (11, 5, =PtrLeft)
 9 | 3 | PtrLeft        2
 10 | 4 | Jnz   (9, 3, =PtrLeft)
 11 | 5 | PtrLeft       10
 12 | 6 | Inc   0
 13 | 7 | Putchar
 14 | 7 | Return
fatal error: tape fell off the left side
Aborted

Though it has a rather different signature if I leave more code in place (this should print the letter 'C' followed by a newline).

$ astrange-bfi-direct <( echo '>+;+[>+>]<[<<]><[-]++++++++[>++++++++<-]>+>-[<<[-]>>>[-]++++[<<<++++++++>>>-]<<<[>>++++++++<<-]>>+[[-]<+++>]]<.>++++++++++.<<'  )
 0 | 0 | PtrRight1
 1 | 0 | Inc    2
 2 | 1 | Jz     (7, 3, =PtrLeft1)
 3 | 2 | PtrRight1
 4 | 2 | Inc1
 5 | 2 | PtrRight1
 6 | 2 | Jnz    (3, 2, =PtrRight1)
 7 | 3 | PtrLeft1
 8 | 3 | Jz     (11, 6, =PtrLeft)
 9 | 4 | PtrLeft        2
 10 | 5 | Jnz   (9, 4, =PtrLeft)
 11 | 6 | PtrLeft       8
 12 | 7 | Set   134523276
 13 | 8 | Jz    Segmentation fault

I'll be adding another test to my program for bad NOP movements.

PS: I've always though the language was more of a 'brainfart' than a 'brainfuck'.

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.