Example #1
0
 def run(self):
     """run game ;-)
     return True if game is over, else False"""
     self.running = True
     ex7.play_hanoi(self, self.nrOfDiscs,
                          self.towerA, self.towerC, self.towerB)
     return True
Example #2
0
 def run(self):
     """run game ;-)
     return True if game is over, else False"""
     self.running = True
     ex7.play_hanoi(self, self.nrOfDiscs,
                          self.towerA, self.towerC, self.towerB)
     return True
Example #3
0
def test_play_hanoi_5():
    src = ['A']
    dest = []
    temp = []
    game = hanoi()
    ex7.play_hanoi(game, 1, src, dest, temp)
    assert src == []
    assert temp == []
    assert dest == ['A']
Example #4
0
def test_play_hanoi_4():
    src = ['A', 'B', 'C', 'D', 'E', 'F', 'G']
    dest = []
    temp = []
    game = hanoi()
    ex7.play_hanoi(game, -4, src, dest, temp)
    assert src == ['A', 'B', 'C', 'D', 'E', 'F', 'G']
    assert temp == []
    assert dest == []
Example #5
0
def test_play_hanoi_1():
    src = ['A', 'B', 'C', 'D', 'E']
    dest = []
    temp = []
    print(type(hanoi))
    game = hanoi()
    ex7.play_hanoi(game, 5, src, dest, temp)
    assert src == []
    assert temp == []
    assert dest == ['A', 'B', 'C', 'D', 'E']