Generate random chess position: Difference between revisions
→{{header|Perl 6}}: fix messed up indentation
m (→{{header|zkl}}: update) |
(→{{header|Perl 6}}: fix messed up indentation) |
||
Line 76:
# If we could not find any, we return recursively
return pick-FEN() unless
my @kings[2] = first -> [$a, $b] {
$a !== $b && abs($a div 8 - $b div 8) | abs($a mod 8 - $b mod 8) > 1
}, (@n X @n);
# We make a list of pieces we can pick (apart from the kings)
|