8fec48eb3772ad6c3b26c8281645c1d94d844f7b
1 // Get the identifier of a HTML square from its numeric coordinates o.x,o.y.
2 function getSquareId(o
)
4 // NOTE: a separator is required to allow any size of board
5 return "sq-" + o
.x
+ "-" + o
.y
;
9 function getSquareFromId(id
)
11 const idParts
= id
.split('-');
12 return [parseInt(idParts
[1]), parseInt(idParts
[2])];