48 hours writing a game in Lua (which indexes from 1) drives this home: in tile-based games, converting screen co-ordinates into tile co-ordinates results in zero-based indices. My graphics routines were full of +1s and -1s as a result.
Generally any time array indexing intersects with mathematics you are going to get the same issue.
That combined with the fact that, in Lua, sometable[0] doesn't produce a not-present exception (it returns 'nil') resulted in a lot of unnecessary cursing.
Generally any time array indexing intersects with mathematics you are going to get the same issue.
That combined with the fact that, in Lua, sometable[0] doesn't produce a not-present exception (it returns 'nil') resulted in a lot of unnecessary cursing.