<s> import numpy as np <EOL> from ple import PLE <EOL> from ple . games . waterworld import WaterWorld <EOL> rewards = { <EOL> "<STR_LIT>" : - <NUM_LIT> , <EOL> "<STR_LIT>" : <NUM_LIT:1.0> , <EOL> "<STR_LIT>" : - <NUM_LIT> , <EOL> } <EOL> game = WaterWorld ( width = <NUM_LIT> , height = <NUM_LIT> , num_creeps = <NUM_LIT:8> ) <EOL> p = PLE ( game , fps = <NUM_LIT:15> , force_fps = False , display_screen = True , <EOL> reward_values = rewards ) <EOL> p . init ( ) <EOL> actions = p . getActionSet ( ) <EOL> for i in range ( <NUM_LIT:1000> ) : <EOL> if p . game_over ( ) : <EOL> p . reset_game ( ) <EOL> action = actions [ np . random . randint ( <NUM_LIT:0> , len ( actions ) ) ] <EOL> reward = p . act ( action ) <EOL> print "<STR_LIT>" . format ( p . score ( ) , reward ) </s>
