Skip to content
Advertisement

Tag: project

In the knights tour challenge, from the coordinates the player is currently on to show the user where they can move

This is from my attempt at the knights tour game, and what I was trying to do here was show the user what moves they could make from whatever position they are in, in the array. The problem arrives with NextPos[x+1][y-2]!=null in the if statement, as the exception java.lang.ArrayIndexOutOfBoundsException: -2 is thrown. I know the array is out of bounds

Advertisement