本文整理汇总了Python中sudoku.Sudoku.start_game方法的典型用法代码示例。如果您正苦于以下问题:Python Sudoku.start_game方法的具体用法?Python Sudoku.start_game怎么用?Python Sudoku.start_game使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sudoku.Sudoku
的用法示例。
在下文中一共展示了Sudoku.start_game方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_sudoku_should_resolve_an_easy_sudoku_with_backtracking_from_TXT_to_result
# 需要导入模块: from sudoku import Sudoku [as 别名]
# 或者: from sudoku.Sudoku import start_game [as 别名]
def test_sudoku_should_resolve_an_easy_sudoku_with_backtracking_from_TXT_to_result(self):
sudoku_test = Sudoku()
settings_test = Settings()
expected_result= ["4 8 3 |9 2 1 |6 5 7 \n", \
"9 6 7 |3 4 5 |8 2 1 \n", \
"2 5 1 |8 7 6 |4 9 3 \n", \
"------+------+------\n", \
"5 4 8 |1 3 2 |9 7 6 \n", \
"7 2 9 |5 6 4 |1 3 8 \n", \
"1 3 6 |7 9 8 |2 4 5 \n", \
"------+------+------\n", \
"3 7 2 |6 8 9 |5 1 4 \n", \
"8 1 4 |2 5 3 |7 6 9 \n", \
"6 9 5 |4 1 7 |3 8 2 \n"]
settings_test.set_config("Algorithm", "Backtracking")
settings_test.set_config("Input", "TXT")
settings_test.write_settings()
sudoku_test.start_game()
file_result = open("../game_results/default.txt", 'r')
result = file_result.readlines()
file_result.close()
self.assertEqual(expected_result, result)