From the course: AI Algorithms for Gaming

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Challenge: Write your own evaluation function

Challenge: Write your own evaluation function - Python Tutorial

From the course: AI Algorithms for Gaming

Start my 1-month free trial

Challenge: Write your own evaluation function

(upbeat music) - [Instructor] If you're feeling up for a challenge, here is an opportunity for you to code some of your intelligence into the cat. Your task is to write an evaluation function. Remember, it must assess how the game looks for the cat because we are running MinMax from the cat's perspective. It must return higher, more positive values, for better estimated outcomes and lower, more negative values, for worse outcomes. And finally a warming. Whose turn it is when we call this evaluation function actually matters. Simply put, if it's the opponent's turn, the cat still faces one certain move against him. Now let me briefly show you the code you'll have to work with. Let's look at the max_Value function in line 233 of CatGame.py. I want to show you where your evaluation function will be called. So that happens in line 246. And notice that we are not simply returning the utility function but actually the…

Contents