I understand the algorithm of how to do it, and that makes like 100% of sense. Total sense. ALL OF IT MAKES SENSE.
But when it comes to programming it, I'm not too sure how to tackle it, cause the recursion should stop once it gets to the end of the board, but that's if I'm doing it for one pawn at a time.
If it isn't, then I can do a general recursion one for the pawns, and I think I would have if statements inside those ones (like saying "if the first pawn is not dead" perform the recursion on that pawn until it reaches the end. If it can only jump once, then the possibleMove for that pawn is 1; adding 1 each time each time that they can do a jump.
Right..but then how would you kill it when it gets to the end of the board? I kind of see where I'm going with this..but..you know. Still super confusing >_<
No comments:
Post a Comment