Errata in Beyond Monty Karel

This listing applies to early printings. They are being corrected as they are found.

Note that the currently published code zip files have updated versions.

Pg 117: Method record is missing a pair of matched parentheses. It should read:

def record(self, fox:Fox, police:Police): #public
    '''Append a move outcome to the current game list
    @param fox: the Fox object
    @param police: a reference to the Police object
    '''
    self._thisGame.append((police.computeValueLocation(), fox.position()))

Pg 120: In several places the length of a list or tuple was given as item.length. This is incorrect. The length is produced by a function: len(item). Method _readFile should be:

def _readFile(self, smart:bool):
    memoryFile = None
    if smart:
        memoryFile = open(self._filename)
        text = memoryFile.read()
        strings = text.split() # a list of strings
        values = list(map(int, strings)) # a list of ints
    k = 0
    for i in range(len(self._history)):
        for j in range(len(self._history[i])):
            if smart:
                self._history[i][j] = values[k]
                k += 1
            else:
                self._history[i][j] = 0