Halite Home

Would like to see a description of input format on the website [it is]


#1

I am trying to write my own version of networking.py and the deserializeMap function is confusing me:

def deserializeMap(inputString):
splitString = inputString.split(" ")

m = GameMap(_width, _height)

y = 0
x = 0
counter = 0
owner = 0
while y != m.height:
    counter = int(splitString.pop(0))
    owner = int(splitString.pop(0))
    for a in range(0, counter):
        m.contents[y][x].owner = owner
        x += 1
        if x == m.width:
            x = 0
            y += 1

for a in range(0, _height):
    for b in range(0, _width):
        m.contents[a][b].strength = int(splitString.pop(0))
        m.contents[a][b].production = _productions[a][b]

return m

I don't understand what the counter is doing here, and it would be very helpful if you can add a part of explanation of the input format to the website for people who want to maintain there own data structure.

Best,


#2

Seems like you only want to send the boarder information of the owner?


#3

It's all documented here: https://2016.halite.io/advanced_writing_sp.php


#4

Thanks. thought it would be called API reference or something..