💡📝H. G. Muller wrote on Sun, Jul 5, 2020 07:23 PM UTC:
Right, I did not account for multiple move borrowers. I do exclude borrowing from the same piece type, as Odin's Rune Chess has a pair of move-borrowing Kings that start next to each other. So I learned about the problem you experienced the hard way too.
Passing a flag that suppresses recursive borrowing, as you suggest, would indeed be a more robust solution. A more complex solution would be to make a list of piece types from which you already borrowed. Or even better, moves that you already borrowed, and don't borrow moves you already have borrowed from another piece (or had to begin with). That would avoid duplication of moves when you have more than one piece of the same type next to you, or pieces with overlapping moves suchas Q and R. Which would greatly increase the efficiency of the AI as long as it has no transposition table.
I think I will go for the simple flag, though, and hope one day I will get to equip the AI with a TT. In fact the infra-structure is already in place: the routine now passes a mask that suppresses some of the modes by clearing their flags, for the purpose of imitation. There I use it for clearing m or c flags. But the x flag is also in there.
Right, I did not account for multiple move borrowers. I do exclude borrowing from the same piece type, as Odin's Rune Chess has a pair of move-borrowing Kings that start next to each other. So I learned about the problem you experienced the hard way too.
Passing a flag that suppresses recursive borrowing, as you suggest, would indeed be a more robust solution. A more complex solution would be to make a list of piece types from which you already borrowed. Or even better, moves that you already borrowed, and don't borrow moves you already have borrowed from another piece (or had to begin with). That would avoid duplication of moves when you have more than one piece of the same type next to you, or pieces with overlapping moves suchas Q and R. Which would greatly increase the efficiency of the AI as long as it has no transposition table.
I think I will go for the simple flag, though, and hope one day I will get to equip the AI with a TT. In fact the infra-structure is already in place: the routine now passes a mask that suppresses some of the modes by clearing their flags, for the purpose of imitation. There I use it for clearing m or c flags. But the x flag is also in there.
[Edit] It should be fixed now. (Untested!)