Anonymous user
Generate Chess960 starting position: Difference between revisions
Generate Chess960 starting position (view source)
Revision as of 05:33, 30 November 2014
, 9 years ago→{{header|REXX}}: used a variable for the LEAVE statement.
m (→generates 960 random positions: optimized the code for piece placement.) |
m (→{{header|REXX}}: used a variable for the LEAVE statement.) |
||
Line 719:
do forever; b2=random(1,8) /* c=color of bishop ►──────┘ */
if @.b2\==. | b2==b1 | b2//2==c then iterate /*bad position*/
leave
end /*forever*/ /* [↑] find a place: 1st bishop.*/
end /* _ */ /* [↑] " " " 2nd " */
Line 757:
do forever; b2=random(1,8) /* c=color of bishop ►──────┘ */
if @.b2\==. | b2==b1 | b2//2==c then iterate /*bad position*/
leave
end /*forever*/ /* [↑] find a place: 1st bishop.*/
end /* _ */ /* [↑] " " " 2nd " */
|