I have Python code that is trying to get the position of a player. However, I always get an error ('cave_' is not defined).
My (error causing)code looks like:
player_pos = cave_(player_pos)[n] #n is a number
The cave
and player_pos
variables have been defined and player_pos
is a tuple. I expect player_pos
to be updated so that its value is something like '5'.
The entire snippet of code looks like:
global player_pos
cave_0 = (1,4,0,0)
cave_1 = (2,11,2,0)
and so on 11 times. Then the offending block of code.
How can this be debugged?