I'm new to python and having some troubles comming off java's very strict and formal OO approach. why does the following code snippet below throw this error, when I'm trying to call GenerateMoves() on an object?
NameError: global name 'CheckIfRegularMove' is not defined
i am trying to call the function CheckIfRegularMove inside of GenerateMoves
how do i call functions inside of a class in python? and a little of background if possible.
thank you in advance
class Position: def __init__(self): .... def GenerateMoves(self): moves =  #upper L moves: if CheckIfRegularMove((2,-1)): print "Yeyeyeah" def CheckIfRegularMove(self,move): tmp = (self.Loaction + move, self.Loaction + move) tuple = (0,1,2,3) if tmp in tuple and tmp in tuple: return True return False