Ok, fair reasoning… No timers used here. Thank you for the feedback. The nature of the infinite loop prevents me from showing live wires because I can only step through the code, unless I am missing something in my debugger. I have **MyPlayerController **selected as my context when in debug mode. Without being able to show the live wires, you asked for it…

**BoardState **= Array of Int, 0 - 63. Represents an 8x8 grid that is the game tiles. If a piece occupies a tiles, it has a value in the array.
Example: **BoardState **= (0,4,8) puts pieces on Row1Column1, R1C3, and R2C1.
**Changer **= Value represents the direction I am looking for movement clearance. Screenshots example checks in front, behind, left, and right. If I wanted to check diagonally in all four directions, it would be four sequences of **Check for Clear Space **using: 7,9,-7,-9 as Changers.
**LastClickIndex **= Single Int. Indicates position of the piece on the board I intend to move
**CheckPosition **= Single Int. Is the array position on the board I am interested in evaluating.
**PossibleMoves **= Array of all moves collected through the sequences for my selected piece to move. I later loop through PossibleMoves to light up my board with the available moves, and use the same array to validate my piece is moving to a valid location.
My three conditions. If any of these are met, bail out of the loop, otherwise, continue adding the **Changer **to **CheckPosition **and try again…
**CheckPosition found in Boardstate array **Top one checks to see if another piece occupies the position I am interested in (CheckPosition)
**CheckPosition < 0 **(the one failing here) Am I beyond boardstate negatively
**CheckPosition > 63 **(also tested from the other side of the board and infinite loop counting up too) Am I beyond the boardstate positively
^^ Additional edge cases will be added if I can get things working
I know I am re-inventing the wheel here but I like a good challenge.
My macro loop checks for clear space for my selected piece to move. With this, I can change how I evaluate available moves based on the type of piece being moved without having to write a tonne of code. This way, I can easily check in front, behind, left, right, diagonally or other locations or directions all by changing number of sequences and the direction (mathematically) using the Changer.
In my case, the piece I am moving is already on the first row and fourth sequence so it has already looked forward, left, right, and now is looking backwards, given the -8 for the sequence being debugged. The piece’s **LastClickIndex **is 2. When I subtract 8 from 2, I get -6 which should indicate as invalid since it is off the board (0 - 63). Since this issue is occurring, it never evaluates to be “off the board” so it goes into infinite loop.
I know I also will have additional logic for other edge cases like wrapping from C8 back to C1, and same with Rows. I was in the beginning stages of this adventure and got hung up on this.
I think I covered the gist of it. I hope I explained things well and am looking forward to feedback.
