~jacksonchen666/brainfuck_interpreter

b1ace52ef79ac2ae38849e3be89922c21e4d5b6a — Jackson Chen 1 year, 17 days ago e320841
use actual filename to read from
1 files changed, 9 insertions(+), 2 deletions(-)

M cmd/test/main.go
M cmd/test/main.go => cmd/test/main.go +9 -2
@@ 3,6 3,7 @@ package main
import (
	"errors"
	"flag"
	"os"

	"git.sr.ht/~jacksonchen666/brainfuck_interpreter"
)


@@ 13,9 14,15 @@ func main() {
	var filename string = ""
	flag.StringVar(&filename, "filename", "", "The filename containing the brainfuck code that will be read.")
	flag.Parse()
	instructions := "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.>.<...++.-.[-]."

	programState := brainfuck_interpreter.InitProgramState(&instructions)
	instructions, err := os.ReadFile(filename)
	if err != nil {
		panic(err)
	}

	real_instructions := string(instructions)

	programState := brainfuck_interpreter.InitProgramState(&real_instructions)

	loop: for {
		err := programState.Step()