MNNIT Computer Coding Club

This repository contains the codes, support links and other relevant materials for every class under Computer Club, MNNIT Allahabad.

View on GitHub

Code Warrior Class-2

September 26th, 2020

Code Warrior Class 2 Recording

Class Content :-

Minimax with Alpha-Beta pruning Algorithm

Additional Resources

Additional Topics

Here is a code for 2k17’s problem statement, you can clone the repo ;) Clash Of Pawns AI

PseudoCode for Minimax with Alpha-Beta Pruning

evaluate (node, alpha, beta)
     if node is a leaf
        return the heruistic value of node
     if node is a minimizing node
        for each child of node
            beta = min (beta, evaluate (child, alpha, beta))
            if beta <= alpha
                return beta
        return beta
     if node is a maximizing node
        for each child of node
            alpha = max (alpha, evaluate (child, alpha, beta))
            if beta <= alpha
                return alpha
        return alpha