changes in variable names
@@ -18,12 +18,12 @@ public class MiniMax {
constructTree(root);
}
- private void constructTree(Node node) {
- List<Integer> listofPossibleHeaps = GameOfBones.getPossibleStates(node.getNoOfBones());
- boolean isMaxPlayer = !node.isMaxPlayer();
+ private void constructTree(Node parentNode) {
+ List<Integer> listofPossibleHeaps = GameOfBones.getPossibleStates(parentNode.getNoOfBones());
+ boolean isChildMaxPlayer = !parentNode.isMaxPlayer();
listofPossibleHeaps.forEach(n -> {
- Node newNode = new Node(n, isMaxPlayer);
- node.addChild(newNode);
+ Node newNode = new Node(n, isChildMaxPlayer);
+ parentNode.addChild(newNode);
if (newNode.getNoOfBones() > 0) {
constructTree(newNode);
}
