def test1 () : "Set up a dual set and show effects" game = Game(sys.argv[1]) before = game.display() tagged = game.getTagged() tags = tagged.keys(); tags.sort() for tag in tags : cell = tagged[tag] for other in game.cells : if other.inx in cell.sameRow : other.val="r" if other.inx in cell.sameCol : other.val="c" if other.inx in cell.sameBox : other.val="b" after = game.display() print sideBySide([before,after])
def test2 () : "Set up a dual set and show effects" game = Game(sys.argv[1]) tagged = game.getTagged() tags=tagged.keys(); tags.sort() before = game.display() for tag in tags : cell = tagged[tag] print " ", tag, cell, cell.pvals cell.update_pvals(game.cells) print " ", tag, cell, cell.pvals after = game.display() print "\n Before After" print sideBySide([before,after])
def test1(): "Set up a dual set and show effects" game = Game(sys.argv[1]) before = game.display() tagged = game.getTagged() tags = tagged.keys() tags.sort() for tag in tags: cell = tagged[tag] for other in game.cells: if other.inx in cell.sameRow: other.val = "r" if other.inx in cell.sameCol: other.val = "c" if other.inx in cell.sameBox: other.val = "b" after = game.display() print sideBySide([before, after])