| 103 | stats.player_stats[player].score = score |
| 104 | |
| 105 | def validate_code(self, agent: Player) -> tuple[bool, str | None]: |
| 106 | if self.submission not in agent.environment.execute("ls")["output"]: |
| 107 | return False, f"No {self.submission} file found in the root directory" |
| 108 | |
| 109 | bot_content = agent.environment.execute(f"cat {self.submission}")["output"] |
| 110 | |
| 111 | if "def get_action(" not in bot_content: |
| 112 | return ( |
| 113 | False, |
| 114 | f"{self.submission} must define a get_action(state) function. " |
| 115 | "See the game description for the required signature.", |
| 116 | ) |
| 117 | |
| 118 | return True, None |