greglo/StackGame

Stack Machine bug

Closed this issue · 1 comments

One of the test cases is now failing, and I believe it is because of the changes you made to the way line indexing works? Might be wrong, but can you look at it?

the bug here was tests peeking an empty stack after the program has finished running, and the EmptyStackException thrown was trying to generate a line number pasat the end of the program and failing. I changed StackMachine.getLine to just use pc in these cases because the line number isn't important at this point