aima/csp.py
def display(self, assignment):
        "Print the queens and the nconflicts values (for debugging)."
        n = len(self.vars)
        for val in range(n):
            for var in range(n):
                if assignment.get(var,'') == val: ch = 'Q'
                elif (var+val) % 2 == 0: ch = '.'
                else: ch = '-'
                print ch,
            print '    ',
            for var in range(n):
                if assignment.get(var,'') == val: ch = '*'
                else: ch = ' '
                print str(self.nconflicts(var, val, assignment))+ch,
            print
def display(self, assignment):
        "Print the queens and the nconflicts values (for debugging)."
        n = len(self.vars)
        for val in range(n):
            for var in range(n):
                if assignment.get(var,'') == val: ch = 'Q'
                elif (var+val) % 2 == 0: ch = '.'
                else: ch = '-'
                print ch,
            print '    ',
            for var in range(n):
                if assignment.get(var,'') == val: ch = '*'
                else: ch = ' '
                print str(self.nconflicts(var, val, assignment))+ch,
            print
def display ( self , assignment ) : n = len ( self . vars ) for val in range ( n ) : for var in range ( n ) : if assignment . get ( var , '' ) == val : ch = 'Q' elif ( var + val ) % 2 == 0 : ch = '.' else : ch = '-' print ch , print '    ' , for var in range ( n ) : if assignment . get ( var , '' ) == val : ch = '*' else : ch = ' ' print str ( self . nconflicts ( var , val , assignment ) ) + ch , print
Print the queens and the nconflicts values (for debugging).
Print the queens and the nconflicts values ( for debugging ) .