The difference was that logride was using a recursive function, and lograys was not. So, I wrote a recursive function for lograys, and I tested it with a Queen that could move anywhere but its own square. Tests showed that it worked correctly for straight riders, turning riders, and winding riders. So, lograys and logride will now match up.
The innermost direction or series of directions is the one that gets repeated, because it repeats any series of directions given to it within parentheses, and it just gets caught in each deeper loop without any means of returning to the outer loop. But since it stops when it runs out of spaces, it avoids an infinite loop.
The difference was that logride was using a recursive function, and lograys was not. So, I wrote a recursive function for lograys, and I tested it with a Queen that could move anywhere but its own square. Tests showed that it worked correctly for straight riders, turning riders, and winding riders. So, lograys and logride will now match up.
The innermost direction or series of directions is the one that gets repeated, because it repeats any series of directions given to it within parentheses, and it just gets caught in each deeper loop without any means of returning to the outer loop. But since it stops when it runs out of spaces, it avoids an infinite loop.