from random_agent import RandomAgent
from search_agent import SearchAgent
from planner_agent import PlannerAgent

def play_game(game_start_state, agent, max_moves):
  positions, moves = [game_start_state], []
  agent.new_game(game_start_state)
  
  for i in xrange(max_moves):
    if positions[-1].is_win:
       break
    move, position = agent.make_move(positions[-1])
    positions.append(position)
    moves.append(move)
  
  return positions, moves
  