Created
April 30, 2015 00:25
-
-
Save louisrli/a747490e9e1a65c2b5d3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import algo | |
import random | |
import time | |
tetris = algo.TetrisLearningProblem() | |
while not tetris.is_terminal(): | |
actions = tetris.get_possible_actions() | |
a = random.choice(actions) | |
reward = tetris.perform_action(a) | |
algo.print_grid(tetris.board) | |
print "Reward: ", reward | |
time.sleep(0.5) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment