Skip to content

Python interpreter for Brainfuck programming language

License

Notifications You must be signed in to change notification settings

bandarji/brainfsck

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

brainfsck

My interpreter for Urban Müller's esoteric programming language, Brainfuck, written in Go and Python.

References

  1. Wikipedia article

Usage

Go

make build && ./bf <fsck'd file>

Python

$ bf.py --help

Specifications

  1. Start with thirty thousand bytes/cells initialized with values of zero.
  2. Track two cursors: position and instruction.
  3. Ignore everything between balanced brackets if the left bracket exists as the first character on the instruction tape.
  4. Accept single-key input and output, using ASCII characters.

Commands

Instruction Description
[ jump to position after corresponding right bracket, if zero
] jump back to corresponding left bracket, if not zero
, accept one input byte
. output value at the position pointer
+ increment the value at the position pointer (255 rotates to zero)
- decrement the value at the position pointer (0 rotates to 255)
> increment the position pointer (rotate to 0 at tape end)
< decrement the position pointer (rotate to 29999 at tape end)

## Tests

This repository includes test files. The following string should produce "Hello World!".

++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.> ---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.

About

Python interpreter for Brainfuck programming language

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published