jeudi 4 juin 2020

How to randomly sample from an iteration of `N` objects in `M` slots with chess pieces?

I have N chess pieces and M squares where M = 64 and 3 <= N <= 7. Only one chess piece can fit on a square at a time. How do I randomly sample arrangements of chess pieces on the chess board?

I do not care if the arrangement on the chess board is legal, I have a later step that will certify legality. Some chess pieces are identical, and so swapping them does not create a new position.

For a more detailed explanation, I am trying to randomly sample from an endgame tablebase and endgame tablebases feature a certain number of pieces on the board. So the KBBNvKQ tablebase has a white king, two white bishops, a white knight, a black king, and a black king.




Aucun commentaire:

Enregistrer un commentaire