C # minimal tree implementation

I am trying to write C # Chess AI.

At this point, I need to build my minmax tree. I am trying to use recursion, but my recursive functions should call themselves about 1,000,000 times for each node. I get an exception after ... 60,000 calls.

+3
source share
4 answers

Given that the recursion depth may not be known, you can stop at a reasonable limit, for example, in 10 moves and / or ignore trees with a lower utility value. By adding additional constraints such as these, you can also ensure that a solution is found quickly, without the need to optimize intensively.

, , , , . , , , , A* , , ,

, , .

.

0

, . , . minimax , .

, , , , , , . , .

+4

9 10. .

, . , ( ) , ( ).

9 . - . .

, , , (.. ).

0
source

if you are interested in learning how to write C # Chess Engine I invite you to visit Computer Chess Blog

The blog post describes creating the C # Chess Engine from the first steps, providing sample C # code.

The most interesting page might be the Move Search and Alpha Beta page.

This article provides a detailed description of the Min Max and Alpha Beta search algorithms, including C # code examples for both.

0
source

Source: https://habr.com/ru/post/1727907/


All Articles