我有一个名为Node<Value>的对象。对象NodeInternal<Value>和NodeLeaf<Value>继承自Node<Value>。我正在尝试使用instanceof测试对象的类型,如下所示:
if (node instanceof NodeInternal)。我没有添加<Value>,因为在运行时,类型会被删除。
无论如何,我正在创建一个无值和交叉/抽搐脚趾游戏与一个完美的人工智能对手,我的目标是使用一个α-β剪枝极小极大的算法。01 function minimax(node, depth, maximizingPlayer)03return the heuristic value of node
05 bestValue := −∞
0