Generate random chess position: Difference between revisions

Content added Content deleted
(→‎{{header|REXX}}: enhanced REXX program to also display a "pictorial" representation of the chessboard and pieces.)
(→‎{{header|REXX}}: corrected program to not append the final "/".)
Line 78: Line 78:
$=strip($,'T',.) /*remove any trailing periods. */
$=strip($,'T',.) /*remove any trailing periods. */
do e=7 for 6 by -1; $=changestr(copies(.,e),$,e); end /*e*/
do e=7 for 6 by -1; $=changestr(copies(.,e),$,e); end /*e*/
fen=fen || translate($,1,.)'/'
fen=fen || translate($,1,.)left('/',r\==1) /*append / if ¬1st./
end /*r*/
end /*r*/
say
say
Line 94: Line 94:
...B....
...B....


FEN=3p/5Pq/Q/2K4N//2q/7k/3B/ w - - 0 1
FEN=3p/5Pq/Q/2K4N//2q/7k/3B w - - 0 1
</pre>
</pre>