Exemplo n.º 1
0
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])
Exemplo n.º 2
0
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])
Exemplo n.º 3
0
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])