Current halite available on map


I’ve looked through the classes but perhaps I’m missing something. Is there a way to reference the current amount of halite available on the map as well as the maximum halite at start without iterating through all the map cells? I thought there’d be something simple like game_map.total_halite.


No, you have to iterate over cells to calculate it. If you worry about perfomance, look at GameMap._update method. Each turn you recieve map updates (diff), so you can precalculate (before call game.ready() you have 10 seconds to do whatever you want) sum/max value and then update it only when needed (and without iteration for sum).