%eden square68 is [1, [[0,0,100,100]], "", formbox(p68, q68), "piece68", DFxmin, DFymin, DFxmax, DFymax, bgcol, DFfgcolor, DFborder, DFalign, 1.0, DFbdcolor, DFfont,DFrelief, "square68"]; kingcol68 is (iscrowned([6,8]) == 1)? red: colsqr68; p68 is pt_add([(x68 - 1.0) * sqwidth + pxoffset, (8.0 - y68) * sqheight + pyoffset], p); A_KingDot68 is "fill=solid,color=" // kingcol68; _KingDot68 is circle(_kingpos, _kingrad); colsqr68 is (Square68 == white)? white:((Square68 == black)? black: bgcolor); _Piece68 is circle(_discpos, _rad); y68 is 8.0; x68 is 6.0; q68 is pt_add([(x68 * sqwidth) + qxoffset, ((9.0 - y68) * sqheight) + qyoffset], p); Square68 is checkcol([6,8], bpieces, wpieces); A_Piece68 is "fill=solid,color=" // colsqr68; func checkcol { para coord; auto ans,i; ans = blank; for (i=1;i<=12;i++){ if (`"b"//str(i)` == coord) ans = black; } for (i=1;i<=12;i++){ if(`"w"//str(i)` == coord) ans = white; } return ans; } func iscrowned { para coord; auto ans, pid; ans = 0; pid = idsq(coord); if ( checkcol(coord) == white ) { ans = wcrowned[pid]; } if ( checkcol(coord) == black ) { ans = bcrowned[pid]; } return ans; } func idsq { para coord; auto ans, i; ans = 0; for (i=1; i<=12; i++){ if (`"b"//str(i)` == coord) ans = i; } for (i=1;i<=12;i++){ if(`"w"//str(i)` == coord) ans = i; } return ans; } wcrowned=[0,0,0,0,0,0,0,0,0,0,0,0]; bcrowned=[0,0,0,0,0,0,0,0,0,0,0,0]; /* valid positions for pieces are: [1,2], [3,1], [5,1], [7,1], [2,2], [2,4] etc and a piece that is placed off the board is at [1000,1000] - initially: b1 = [2,6]; b10 = [4,8]; b11 = [6,8]; b12 = [8,8]; b2 = [4,6]; b3 = [6,6]; b4 = [8,6]; b5 = [1,7]; b6 = [3,7]; b7 = [5,7]; b8 = [7,7]; b9 = [2,8]; bcrowned = [0,0,0,0,0,0,0,0,0,0,0,0]; w1 = [1,1]; w10 = [3,3]; w11 = [5,3]; w12 = [7,3]; w2 = [3,1]; w3 = [5,1]; w4 = [7,1]; w5 = [2,2]; w6 = [4,2]; w7 = [6,2]; w8 = [8,2]; w9 = [1,3]; wcrowned = [0,0,0,0,0,0,0,0,0,0,0,0]; */