Skip to content

Instantly share code, notes, and snippets.

@felko
felko / fibonacci.bf
Last active June 28, 2016 16:14
Loads in memory the fibonacci suite (but doesn't display it)
FIBONACCI SEQUENCE
You have to use an IDE or website in order to visualize the memory
+++++++> The number of numbers to load
+>+> Setup the two first numbers
<[<]>[
[>] Move to the right most ptr
<< [->>+>+<<<] Store the first number in the 2 next free ptr
>>>[<<<+>>>-] Shift the last value in the first number ptr
#!/usr/bin/env python3.4
# coding: utf-8
from collections import ChainMap
class Bytecode:
def __init__(self, instructions):
self.instructions = instructions
def __str__(self):
#!/usr/bin/env python3
# coding: utf-8
import re
from collections import namedtuple
from functools import wraps
class ParseError(Exception):
pass