I'm trying to implement pathfinding into Colonization. However, this is effectively the first real thing I've ever programmed, and I'm in highschool, so I haven't taken any in-depth computer classes. In other words, I am vastly unexperienced. I've written and re-written the algorithm a number of times, even downloaded an A* implementation from the web, but everything has some problem or other. The simulator isn't actually kicking out any errors, there are just some issues. I extracted the script from delirious' Tiled library, and it almost worked. I need help. The map is only 10x10 tiles (100 total, so very small--even an inefficient algorithm will work for me), and it's not vital that the path even be the shortest. Movement includes diagonal, but it wouldn't have to if a script wasn't suited for that. Below is my most recent attempt which, again, isn't working (it seems to loop infinitely, and I think the openList grows beyond 100, which shouldn't happen since there are only that many tiles. I also think it includes duplicates, which the onList() function should prevent), and I can't figure out why. Any help would be greatly appreciated

I found this lin ein function passable:
if x > 0 and x < 101 and y > 0 and y < 101 and game.mapList[gridToIndex(x, y)] == 0
are you sure, that you have map 101x101

Thanks! Indeed, that was an error I had missed. However, the problem persists. Out of curiosity, I added a print() function which displays the length of openList. Though this number should never be above 100 (that's the size of my map), it quickly escalates into the thousands. The most logical reason would be a problem with my onList(list, x, y) function, which would return false if there was no other tile with the same coordinates, and an index number if there was (thus preventing duplicates), but I don't see any issues with that function. I am at a loss.