Any way to have default input parameters for functions, like I try to do here, setting Depth to 3 by default. I would like to then be able to call the function like this:
GenerateAlphaBetaTree(MyBoard) # uses depth 3
Any way to have default input parameters for functions, like I try to do here, setting Depth to 3 by default. I would like to then be able to call the function like this:
GenerateAlphaBetaTree(MyBoard) # uses depth 3
You just need to add the ?
before the parameter name:
GenerateAlphaBetaTree(Board:board,?Depth:int = 3)<sus...
Thx, how would this work when I want to call this function with a different depth value, like 4?
You also need to specify the argument name:
GenerateAlphaBetaTree(MyBoard, ?Depth := 4)