fuckery.memory module¶
pyFuckery - memory.py Created on 2/12/17.
Memory object implementation. Provides memory bounds checking, as well as value enforcement.
-
class
fuckery.memory.
Storage
(n=30000)[source]¶ Bases:
object
Provides an interface for storing memory values for the Brainfuck VM.
This provides for type safety & memory access checking.
Init function for Storage.
Parameters: n – Number of memory cells to create. -
get
(addr)[source]¶ Get the value of the memory at a location.
Parameters: addr – Memory address to retrieve. Returns:
-
mem_hash
¶ Returns a hash of the state of the memory.
Note - Computing this frequently can be expensive to do as the memory section is serialized via msgpack.dumps() prior to hashing.
Returns:
-