Python3, Halite bot working locally but not in webeditor


#1

When I try to run my bot in the online editor it keeps giving me this error: TypeError: unhashable type: ‘Position’
Which is wierd since it works fine when i run it locally.
Code piece in question:

for u in unpacked_grid:
    halite = game_map[u].halite_amount
    halite_at_pos[u] = halite

So I figured I could just convert the folder to a zip and then upload that, however whenever I try to upload that, it doesn’t do anything when I click submit.

Help is much appreciated, since I don’t want to rewrite my entire code.


#2

It sounds like your version of the hlt library is different from that in the online editor. I’d go with uploading a zip as the way to upload if you are working locally.

For the problem uploading the zip - are you logged in? That’s usually the issue when I have this sort of problem.


#3

The online editor has a slightly outdated starter kit. We’ll be updating this shortly, but you’ll have to reset the editor to pick up the changes.


#4

@Som_om, we’ve updated the starter kit in the online editor. To continue working on your bot in the editor, please do the following:

  • Download your current bot: Editor > Download
  • Reset the starter kit: Editor > Settings > “Delete Bot and Reset Language”
  • Replace the default MyBot.py with the contents of your downloaded MyBot.py file

Please let us know if you have any issues.


#5

This happened to me also, the problem was the editor one doesn’t have hash code implemented for several objects. Use zip; easier to keep track of versions, store all your zips versioned.