Persistant Data

To allow you to keep track of data between submitting a move for processing we offer a data dictionary called persistentData that will preserve it's contents between calls to calculateMove.

This data dictionary will initially be empty so will need to check to see if a key exists before setting or altering its value. For example if you wanted to keep count of the number moves you have submitted you could use the following code:

if "moveCount" not in persistentData:
    persistentData["moveCount"] = 0
else:
    persistentData["moveCount"] += 1
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License