itsapi / pycraft

A Minecraft-inspired game for the terminal
GNU General Public License v2.0
197 stars 21 forks source link

Map Indexes as Strings #68

Closed olls closed 8 years ago

olls commented 8 years ago

Why are we using strings for the map indexes? I thought it might be for negative indexes, but that works fine:

>>> a = {}
>>> a[-1] = 'asdf'
>>> a
{-1: 'asdf'}
>>> a[-1]
'asdf'

Is it just because it comes out of storage that way? If so we could easily change it to use ints, and save a lot of silly bugs. It's probably left over from when we were directly using the JSON straight from the file with no parsing...