0
我正在學習Alpha-Beta僞代碼,我想爲Alpha Beta修剪寫一個最簡單的僞代碼。將Minimax修改爲Alpha-Beta修剪僞代碼
我寫的僞代碼爲極小:
function minimax(node, depth)
if node is a terminal node or depth ==0
return the heuristic value of node
else
best = -99999
for child in node
best = max(best, -minimax(child, depth-1))
return best
不過,我不知道如何修改它變成α-β剪枝。誰能幫忙?