human
Give me a the Python program you requested given the following:
I am working on the file "Python/3 Games/Alpha-Beta-Pruning-Pure.ipynb".
The first task is:
Naive Memoization
The implementation of memoize that is given below uses the fact that the functions alphaBetaMax and alphaBetaMin are never called with the same arguments.
Can you write Python program for it?
assistant
#Here is the Python program you requested.

gCache = {}

def memoize(f):
    global gCache
    
    def f_memoized(*args):
        if args in gCache:
            return gCache[args]
        result = f(*args)
        gCache[args] = result
        return result
    
    return f_memoized

alphaBetaMax = memoize(alphaBetaMax)
alphaBetaMin = memoize(alphaBetaMin)

%%time
val = alphaBetaMax(gStart, -1, 1)