Talk:Generate Chess960 starting position: Difference between revisions
Content deleted Content added
m →random starting position: updated the REXX program which produces the histograph/histogram. |
|||
Line 79:
file 8=270847 ============================================================
</pre>
The REXX program to produce the
<lang rexx>/*REXX program generates a histogram of 100,000 rook placement positions*/
parse arg seed times . /*obtain optional args from C.L. */
if times=='' then times=100000
if seed\=='' then call random ,,seed /*if SEED specified, use the seed*/
rooks.=0 /*zero the rook position counters*/
do t=1 for times /*═════════════════════════════════════════════════*/
r1=random(1
if r2==r1p then iterate /* " " after " */▼
end /*forever*/▼
▲ end /*forever*/
rooks.r1=rooks.r1+1 /*bump rook (r1) position counter*/
end /*t ════════════════════════════════════════════════════════════*/
mx=0; do j=1 for 8; mx=max(mx,rooks.j); end /*find max histo value*/
|