课程: AI Algorithms for Game Design with Python
免费学习该课程!
今天就开通帐号,24,700 门业界名师课程任您挑!
Solution: An iteratively deepening cat - Python教程
课程: AI Algorithms for Game Design with Python
Solution: An iteratively deepening cat
(upbeat music) - [Instructor] Let's look at my solution. We start at line 482 by initializing best_depth, which is the deepest successful depth we will report in the end, and output_move, which is the return value. The main loop starts at line 486 where we iterate for depths starting at 1 and ending in the maximum number of possible turns. In the body of the loop, the first thing we do is reset the reached_max_depth fly. Then, in lines 488 and 489, we perform limited depth search with the current depth and assign the resulting move to best_move. In line 491, we check if time is up, in which case, best_move will be a timeout, and so, we can exit this for loop and report the latest output_move, that is the best_move in the previous iteration of this loop. Now, if the limited depth finished on time, we go to line 494. First, we update output_move to the current value of best_move. Then, best_depth will be recorded as the current value of depth. In lines 496 through 499, we report the…
内容
-
-
-
-
-
-
(已锁定)
The iterative deepening technique2 分钟 56 秒
-
(已锁定)
Is iterative deepening a waste of time?7 分钟 41 秒
-
(已锁定)
Challenge: An iteratively deepening cat38 秒
-
(已锁定)
Solution: An iteratively deepening cat5 分钟 27 秒
-
(已锁定)
Is iterative deepening really that good?2 分钟 37 秒
-
(已锁定)
Is alpha-beta pruning really that good?4 分钟 35 秒
-
(已锁定)
-
-