MCPcopy Create free account
hub / github.com/CodeClash-ai/CodeClash / validate_code

Method validate_code

codeclash/arenas/gomoku/gomoku.py:71–84  ·  view source on GitHub ↗
(self, agent: Player)

Source from the content-addressed store, hash-verified

69 stats.player_stats[player].score = score
70
71 def validate_code(self, agent: Player) -> tuple[bool, str | None]:
72 if self.submission not in agent.environment.execute("ls")["output"]:
73 return False, f"No {self.submission} file found in the root directory"
74
75 bot_content = agent.environment.execute(f"cat {self.submission}")["output"]
76
77 if "def get_move(" not in bot_content:
78 return (
79 False,
80 f"{self.submission} must define a get_move(board, color) function. "
81 "See the game description for the required signature.",
82 )
83
84 return True, None

Callers

nothing calls this directly

Calls 1

executeMethod · 0.45

Tested by

no test coverage detected