The recursiveVersion and iterativeVersion methods are supposed to state whether game can be won or not.
The instructions for how the game is played can be found here.:
https://www.docdroid.net/YOP9dkK/stuckonprogrammingquestion.pdf#page=3
My recursiveVersion method works well for both good and bad inputs.
My iterativeVersion method only works well for good inputs.
Here is the code with the iterativeVersion method (in the TheRowGame class).:
http://dpaste.com/1T7YXQX
Here is the code for the helper class, StackFrame.:
http://dpaste.com/2K0WTD8
Here is the error I am getting.:
http://dpaste.com/3A9512X
Why is the index not always in the interval [0,9]?
Could someone please help me fix this issue?
Any help in fixing this issue would be greatly appreciated!
P.S.
I'm aware that I can fix other minor things like making the methods static, but right now, I just want to focus on the more difficult stuff, which, for me, at least, is getting this bug fixed.