Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,32 @@
|
|||
char Col;
|
||||
|
||||
func ColNum(Start, Piece); \Return column number of Piece
|
||||
int Start, Piece, I;
|
||||
[for I:= Start to 7 do
|
||||
if Col(I) = Piece then return I;
|
||||
return -1;
|
||||
];
|
||||
|
||||
proc Shuffle; \Randomly rearrange pieces in columns
|
||||
int I, J, T;
|
||||
[for I:= 8-1 downto 1 do
|
||||
[J:= Ran(I); \range [0..I-1] (Sattolo cycle)
|
||||
T:= Col(I); Col(I):= Col(J); Col(J):= T;
|
||||
];
|
||||
];
|
||||
|
||||
int N, B1, B2, BOK, R1, R2, K, KOK;
|
||||
[for N:= 1 to 5 do
|
||||
[Col:= "RNBQKBNR ";
|
||||
repeat Shuffle;
|
||||
B1:= ColNum(0, ^B);
|
||||
B2:= ColNum(B1+1, ^B);
|
||||
BOK:= ((B1 xor B2) and 1) # 0;
|
||||
R1:= ColNum(0, ^R);
|
||||
R2:= ColNum(R1+1, ^R);
|
||||
K:= ColNum(0, ^K);
|
||||
KOK:= R1<K and K<R2;
|
||||
until BOK and KOK;
|
||||
Text(0, Col); CrLf(0);
|
||||
];
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue