New answers tagged

2

It looks to me like what you really want is a 2D array for managing your board state, which in JavaScript you can accomplish with a nested array. Your x & y coordinates stay as plain integers internally, so you can use them as indexes into the first/outer and second/inner dimensions of the array. This makes it easy to add and subtract coordinates, or ...


Top 50 recent answers are included