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:
set(addr, value)[source]

Set the value of the memory at a locaiton.

Parameters:
  • addr – Memory address to set.
  • value – Value to set.
Returns:

fuckery.memory.main(options)[source]
fuckery.memory.makeargpaser()[source]