本文整理汇总了Python中term2048.game.Game.score方法的典型用法代码示例。如果您正苦于以下问题:Python Game.score方法的具体用法?Python Game.score怎么用?Python Game.score使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类term2048.game.Game
的用法示例。
在下文中一共展示了Game.score方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_save_best_score_with_file
# 需要导入模块: from term2048.game import Game [as 别名]
# 或者: from term2048.game.Game import score [as 别名]
def test_save_best_score_with_file(self):
scores_file = NamedTemporaryFile(delete=True)
g = Game(scores_file=scores_file.name)
g.best_score = 0
g.score = 1000
g.saveBestScore()
self.assertEqual(g.best_score, 1000)
示例2: test_start_game_resume
# 需要导入模块: from term2048.game import Game [as 别名]
# 或者: from term2048.game.Game import score [as 别名]
def test_start_game_resume(self):
cellvalue = 2
g1 = Game(scores_file=None)
g1.board.setCell(0, 0, cellvalue)
g1.score = 42
self.assertTrue(g1.store())
sys.argv = ['term2048', '--resume']
g2 = ui.start_game(debug=True)
self.assertEqual(cellvalue, g2.board.getCell(0, 0))
self.assertEqual(g1.score, g2.score)