Problem with writing to nested dictionaries


I've been banging my head trying to work out why my nested dictionaries are being written to. Here, I am trying to write to player 1, round 1 only. However, as you can see, Im writing to player 2 as well. Can anyone see why?

Before click:

After click:

Use the Copy Dictionary block liberally, to avoid having multiple dictionaries point to the same dictionary in memory.

The penny drops!

I didn't realise that I was pointing to the same dictionary.

Thanks! I feel a bit stupid, considering the time i've spent on it.

The same thing happens with lists.

AI2 lists are linked lists.

Have some fun with this one:

This was my solution in the end. I probably went overboard on the copies.

Thanks for the info.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.