Practical tips debugging deep recursion?

前端 未结 8 1939
长情又很酷
长情又很酷 2021-02-13 06:33

I\'m working on a board game algorithm where a large tree is traversed using recursion, however, it\'s not behaving as expected. How do I handle this and what are you experience

8条回答
  •  隐瞒了意图╮
    2021-02-13 07:24

    One thing I have done in the past is to format your logs to reflect the recursion depth. So you may do a new indention for every recurse, or another of some other delimiter. Then make a debug dll that logs everything you need to know about a each iteration. Between the two, you should be able to read the execution path and hopefully tell whats wrong.

提交回复
热议问题