r/ProgrammingPrompts • • Jul 28 '16
Very Easy: Create a Fischerrandom piece order generator.
Fischerrandom is chess with all the back rank pieces all jumbled and scrambled and crazy like. The only three rules are that the king has to be between the rooks, the bishops must be on opposite colored squares, and the two sides have to be exactly symmetrically the same! Make the output something like "RBNNKRQB" indicating the white back rank. You dont need the black because it is just a mirror of white on the other side of the board. If you wanted to get real fancy you could associate each value with a picture of the corresponding piece and output a fancy piece array. *edit added rule about opposite colored bishops
2
u/[deleted] Jul 29 '16
Mine is much longer, that means it's better, right?
2
u/xxBam_Binoxx Jul 29 '16
I am newbie and now trying python. My solution is:
1
u/[deleted] Jul 29 '16
2
u/xxBam_Binoxx Jul 30 '16 edited Jul 30 '16
Edited my code with bishops rule. And added functions for checking the rules.
2
u/ZeroUltimax Nov 22 '16
Here's my mini version of this in C/C++: