def run_episode(env):
    """run_episode runs a game by executing a random policy

    Parameters
    ----------
    env : ObstacleTowerEnv
        game environment with OpenAI gym wrapper

    Returns
    -------
    float
        reward earned in the episode
    """
    done = False
    episode_reward = 0.0
    
    while not done:
        action = env.action_space.sample()

        # run one timestep of the environment's dynamics
        # obs - agent's observation of the current environment
        # reward - amount of reward returned from previous action
        # done - whether the episode has ended
        # info - auxialiary diagnostic information
        obs, reward, done, info = env.step(action)
        episode_reward += reward
        
    return episode_reward