コード例 #1
0
ファイル: test_ia.py プロジェクト: zd123/term2048-AI
from term2048.board import Board
from term2048.game import Game

game = Game()
score = game.loopAI()
won = game.board.won()
print score
コード例 #2
0
from term2048.board import Board
from term2048.game import Game

out_file = open("benchmark.txt", "w")

for i in range(0, 51):
    game = Game()
    score = game.loopAI(sleep_time=0)
    maxVal = game.board.maxValue()
    won = game.board.won()
    out_file.write(str(i) + "\t")
    out_file.write(str(score) + "\t")
    out_file.write(str(maxVal) + "\t")
    out_file.write("\n")
    out_file.flush()
コード例 #3
0
ファイル: benchmark_ia.py プロジェクト: Nicola17/term2048-AI
from term2048.board import Board
from term2048.game import Game

out_file = open("benchmark.txt","w")

for i in range(0,51):
    game = Game()
    score = game.loopAI(sleep_time=0)
    maxVal = game.board.maxValue()
    won = game.board.won()
    out_file.write(str(i)+"\t")
    out_file.write(str(score)+"\t")
    out_file.write(str(maxVal)+"\t")
    out_file.write("\n")
    out_file.flush()