Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Interpreter ¶
type Interpreter struct { Program []byte ProgramPosition int Memory [memorySize]int64 MemoryPosition int Output strings.Builder Input string // contains filtered or unexported fields }
Interpreter represents a Brainf--k interpreter containing the program and memory which may be run.
func (*Interpreter) Clock ¶
func (ipr *Interpreter) Clock() bool
Clock runs one cycle/tick of the interpreter. It returns false when the program ends.
func (*Interpreter) Init ¶
func (ipr *Interpreter) Init()
Init initialises an interpreter by resetting the memory position.
func (*Interpreter) LoadProgram ¶
func (ipr *Interpreter) LoadProgram(data []byte)
LoadProgram loads a program to the interpreter and builds a bracket map.
Click to show internal directories.
Click to hide internal directories.