Halite Home

How are x and y calculated?


#1

This might sound like a stupid question, and it probably is, but if I ask my code what the x and y coordinates of a cell in the top left corner are, would it return 1 and 1, because it's in the first row of the first column, or would it return 0 and 0, like how arrays work?

Thanks,
~Robin


#2

I believe it would be 0,0.


#3

Generally 0,0 but languages with 1 based indexing will probably be 1,1 (such as the julia starter kit).

Edit: actually after inspecting the julia starter bot it seems it will return 0,0 as well (and adds one to each coordinate when accessing the arrays).