Skip to content

Instantly share code, notes, and snippets.

@louisrli
Created April 30, 2015 00:25
Show Gist options
  • Save louisrli/a747490e9e1a65c2b5d3 to your computer and use it in GitHub Desktop.
Save louisrli/a747490e9e1a65c2b5d3 to your computer and use it in GitHub Desktop.
#!/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