알파 베타 전정 알고리즘에서 나는 함수 정의 getAction (self, gamestate) id가 정의 된 클래스가 있습니다.파이썬에서 알파 베타 전정
class BAC:
def you(self,gamestate):
def me(gamestate,depth,alpha, beta):
------
return v
def both(gamestate,depth,alpha, beta):
-------------------
return v
return me(gamestate,0,alpha, beta)-
내가 기능에 나와 모두 알파, 베타를 둘 필요가 : 나는
처럼 데프 getAction 2 개 기능을했다. 그러나 알파와 베타 값은 어디에서 정의해야합니까? 알파와 베타를 def me와 def에서 모두 정의하면 둘 다 전역 이름 알파가 없으므로 오류가 발생합니다.
어떻게 알파 및 베타 로컬 변수를 만들 수 있습니까? 또는 어떻게 올바르게 작동시킬 수 있습니까?
누군가 당신을위한 코드가 될 것입니까? – djondal