Skip to content

Commit 083bca7

Browse files
committed
Minor Halite validation
1 parent 412ec7f commit 083bca7

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

codeclash/games/halite/halite.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,11 @@ def get_results(self, agents: list[Player], round_num: int, stats: RoundStats):
121121
stats.player_stats[player].score = score
122122

123123
def validate_code(self, agent: Player) -> tuple[bool, str | None]:
124+
# Check that the `submission/` folder exists
125+
exists_output = agent.environment.execute("test -d submission && echo 'exists'")["output"]
126+
if "exists" != exists_output.strip():
127+
return False, f"Submission folder `{self.submission}/` does not exist"
128+
124129
# Check that there is a *single* file called "main.<ext>" in the submission folder
125130
# and that <ext> is one of the supported file types
126131
sub_path = Path(agent.environment.config.cwd) / self.submission

0 commit comments

Comments
 (0)