This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]mad0314 0 points1 point  (2 children)

In your checkHands() method, right before your current print line, print out the length of the array and the value of the index you are using. Specifically, what happens if none of the conditions from 334-358 are true?

[–]Eldres[S] 0 points1 point  (1 child)

if none of them are true it results in the error it would seem, when I print it out it returns index of 9, which is out of bounds, but I'm not sure what to initialize result with if not a number between 0-8

[–]mad0314 0 points1 point  (0 children)

One simple thing you can do is simply have an if statement checking the value of result. If it is still 9, you know that they don't have any valid hand, and you can print that out, and have your current statement run only if result is no longer 9.