~jacksonchen666/brainfuck_interpreter

f7a66df163eed2709788472a4e73b8bbfbbf1d1b — Jackson Chen 1 year, 1 month ago f117f97
tiny bug fix

end of code detected too late, out of bounds error
1 files changed, 1 insertions(+), 1 deletions(-)

M brainfuck.go
M brainfuck.go => brainfuck.go +1 -1
@@ 53,7 53,7 @@ func getChar() (byte, error) {

// Does a single brainfuck instruction.
func (ps *ProgramState) Step() error {
	if ps.codePointer > len(*ps.code) { // len: wasteful? store in program state?
	if ps.codePointer >= len(*ps.code) { // len: wasteful? store in program state?
		return EOF
	}
	if ps.memoryPointer >= len(*ps.tape) {