Fischer Chess Positions in TDD
A re-examination of a TDD kata proposed long ago
The original challenge was raised by Peter Siebel
In a variant of chess called Fischer Random Chess, you start the board in a (partially) random position according to the following rules. You place the pawns in their normal starting positions. Then you place the white pieces in the first rank in a random arrangement excepting that:
- The bishops are each on different colored squares.
- The king is somewhere between the two rooks.
Then the black pieces are placed in there corresponding places on the other side of the board.
Write a function (method, procedure, whatever) that returns a randomly generated legal arrangement of the eight white pieces.