Skip to content

Commit

Permalink
make python_example py3 compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
nadavbh12 committed Jan 31, 2018
1 parent 7a60811 commit 0269da8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions doc/examples/python_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from rle_python_interface import RLEInterface

if len(sys.argv) < 2:
print 'Usage:', sys.argv[0], 'rom_file', 'core_file'
print('Usage:', sys.argv[0], 'rom_file', 'core_file')
sys.exit()

rle = RLEInterface()
Expand Down Expand Up @@ -38,12 +38,12 @@
minimal_actions = rle.getMinimalActionSet()

# Play 10 episodes
for episode in xrange(10):
for episode in range(10):
total_reward = 0
while not rle.game_over():
a = minimal_actions[randrange(len(minimal_actions))]
# Apply an action and get the resulting reward
reward = rle.act(a)
total_reward += reward
print 'Episode', episode, 'ended with score:', total_reward
print('Episode', episode, 'ended with score:', total_reward)
rle.reset_game()

0 comments on commit 0269da8

Please sign in to comment.