"""The starter: ARC-AGI-3-Agents' random agent, which picks any action the game offers and clicks anywhere. Copy it into routes//agent.py and make an agent that learns a game's rules as it plays: the referee calls choose_action(frames, latest_frame) every step, as the official agents framework does.""" import random from arcengine import GameAction, GameState class Agent: def is_done(self, frames, latest_frame): return latest_frame.state is GameState.WIN def choose_action(self, frames, latest_frame): if latest_frame.state in (GameState.NOT_PLAYED, GameState.GAME_OVER): return GameAction.RESET action = GameAction.from_id(random.choice(latest_frame.available_actions)) if action.is_complex(): return action, {'x': random.randrange(64), 'y': random.randrange(64)} return action