Skip to content

A stack based, streaming brainfuck interpreter written in golang ;)

License

Notifications You must be signed in to change notification settings

swd543/brainfucked

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

brainfucked

Build Coverage

A stack based, streaming brainfuck interpreter written in golang ;)

Running

cd brainfuck && go run . ../programs/helloworld.bf

Testing

cd interpret && go test -v -cover

Adding as a package

Add the interpret package => go get github.com/swd543/brainfucked/interpret

Initialize the interpreter state

state := interpret.NewState[int](programReader, programOutputWriter, inputReader)

Adding custom commands (for squaring)

state.AddOrReplaceCommand('*', func(state *interpret.State[int]) {
  state.Data[state.Dp] *= state.Data[state.Dp]
  state.Pc++
})

About

A stack based, streaming brainfuck interpreter written in golang ;)

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published