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
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']
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 == []
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']