Can someone explain this for me please?

Solved.
Last edited on
Can someone just summarize what these three functions are doing please?
Nim::Minimax(Node node) calls GetScoreNode() on each node in a binary tree and returns the largest value. It doesn't by calling itself recursively. Hmm. Actually it might have a bug: line 17 assumes that if a node has one child, then the child is a leaf. Is that guaranteed?

GetScoreNode appears to compute the score of a node based on the game's rules. I don't know the game so I can't comment on this.

SetChildrenNode appears to setup the m_Children collection. One thing that strikes me as odd here is that m_Children isn't erased at the beginning. So if you call SetChildrenNode serveral times, you'll add more and more children m_Children. This might be okay, depending on the rest of the code.
Topic archived. No new replies allowed.