Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Plus instruction constant Plus byte = '+' // Minus instruction constant Minus byte = '-' // Right instruction constant Right byte = '>' // Left instruction constant Left byte = '<' // PutChar instruction constant PutChar byte = '.' // ReadChar instruction constant ReadChar byte = ',' // JumpIfZero instruction constant JumpIfZero byte = '[' // JumpIfNotZero instruction constant JumpIfNotZero byte = ']' )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Interpreter ¶
type Interpreter struct {
// contains filtered or unexported fields
}
Interpreter brainfuck interpreter type
func NewInterpreter ¶
NewInterpreter creates an interpreter instance
func (*Interpreter) Execute ¶
func (i *Interpreter) Execute() error
Execute executes the brainfuck code
func (*Interpreter) IsValid ¶
func (i *Interpreter) IsValid() error
IsValid validates brainfuck code it ensures that code doesn't start with `]` and has a matching `[` and `]`
Click to show internal directories.
Click to hide internal directories.